You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if I am doing anything wrong or if some small changes are needed to the linux_gnu.def or to vadd_heap.c file:
$ git rev-parse HEAD
742cab2e84c164fe67ddc023e8421121e517e791
$ git st
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: make.def
#
no changes added to commit (use "git add" and/or "git commit -a")
$ diff -s make.def Make_def_files/linux_gnu.def
Files make.def and Make_def_files/linux_gnu.def are identical
$ gcc --version
gcc (GCC) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ make
g++ -fopenmp -O3 -c pi.c
g++ -fopenmp -O3 -o pi pi.o -lm
g++ -fopenmp -O3 -c jac_solv.c
g++ -fopenmp -O3 -c mm_utils.c
g++ -fopenmp -O3 -o jac_solv jac_solv.o mm_utils.o -lm
g++ -fopenmp -O3 -c vadd.c
g++ -fopenmp -O3 -o vadd vadd.o -lm
g++ -fopenmp -O3 -c vadd_heap.c
vadd_heap.c: In function ‘int main()’:
vadd_heap.c:14:18: error: ‘malloc’ was not declared in this scope
14 | float *a = malloc(sizeof(float) * N);
| ^~~~~~
vadd_heap.c:3:1: note: ‘malloc’ is defined in header ‘<cstdlib>’; did you forget to ‘#include <cstdlib>’?
2 | #include <omp.h>
+++ |+#include <cstdlib>
3 | #define N 100000
vadd_heap.c:41:4: error: ‘free’ was not declared in this scope
41 | free(a);
| ^~~~
vadd_heap.c:41:4: note: ‘free’ is defined in header ‘<cstdlib>’; did you forget to ‘#include <cstdlib>’?
make: *** [vadd_heap.o] Error 1
Not sure if I am doing anything wrong or if some small changes are needed to the
linux_gnu.def
or tovadd_heap.c
file:On the other hand, building with https://developer.nvidia.com/hpc-sdk aka PGI (see below for version) works as intended
The text was updated successfully, but these errors were encountered: