HPImaging / sv-mbirct

High Performance Model Based Image Reconstruction for Computed Tomography
BSD 3-Clause "New" or "Revised" License
6 stars 7 forks source link

Compiler warnings in GCC #6

Closed smajee closed 4 years ago

smajee commented 4 years ago

make -C svmbir/sv-mbirct/src -f Makefile.gcc make: Entering directory `/depot/bouman/users/smajee/py-svmbir/svmbir/sv-mbirct/src' gcc -fopenmp -O3 -c -o mbir_ct.o mbir_ct.c gcc -fopenmp -O3 -c -o initialize.o initialize.c gcc -fopenmp -O3 -c -o recon3d.o recon3d.c In file included from recon3d.c:4:0: /apps/spack/rice/apps/intel-parallel-studio/cluster.2017.1-intel-17.0.1-2off4ih/include/math.h:108:3: error: #error "This Intel is for use with only the Intel compilers!"

error "This Intel is for use with only the Intel compilers!"

^ recon3d.c: In function ‘MBIRReconstruct3D’: recon3d.c:109:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] order = (int ) aligned_alloc(64,sumSV_per_Zsizeof(int)); ^ recon3d.c:191:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] voxelsBuffer1 = (float ) aligned_alloc(64,Nxysizeof(float)); ^ recon3d.c:192:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] voxelsBuffer2 = (float ) aligned_alloc(64,Nxy*sizeof(float)); ^ make: *** [recon3d.o] Error 1 make: Leaving directory `/depot/bouman/users/smajee/py-svmbir/svmbir/sv-mbirct/src'

sjkisner commented 4 years ago

Soumendu,

Can you try adding "-std=c11" to the gcc flags and see if that makes the cast warning go away? I can't reproduce the warning on my end.

The math.h error looks like an environment issue. I don't offhand see anything in the code that would specify using the Intel math.h. Also, did you clear out all the object files before you compiled and got this error?

sjkisner commented 4 years ago

Adding "-std=c11" fixed the aligned_alloc() cast warnings. Intel error was a local environment issue.