Undefined symbols for architecture x86_64:

Hi,
I'm trying to compile the following software using cmake:
https://github.com/fabienbaron/bsmem
But it fails when I run the make command and I get this message:

Code Block language
[ 16%] Building C object src/CMakeFiles/bsmem.dir/bsmem.c.o
In file included from /Users/youcef/Documents/bsmem-/src/bsmem.c:56:
/Users/youcef/Documents/bsmem-/src/bsmem.h:135: warning: "M_PI" redefined
  135 | #define M_PI 3.14159265358979323
      | 
In file included from /Users/youcef/Documents/bsmem-/src/bsmem.h:12,
                 from /Users/youcef/Documents/bsmem-/src/bsmem.c:56:
/opt/local/lib/gcc10/gcc/x86_64-apple-darwin19/10.1.0/include-fixed/math.h:707: note: this is the location of the previous definition
  707 | #define M_PI        3.14159265358979323846264338327950288   /* pi             */
      | 
[ 33%] Building Fortran object src/CMakeFiles/bsmem.dir/bsmemf.f.o
[ 50%] Building C object src/CMakeFiles/bsmem.dir/free_fits.c.o
[ 66%] Building C object src/CMakeFiles/bsmem.dir/read_fits.c.o
[ 83%] Building Fortran object src/CMakeFiles/bsmem.dir/vector.f.o
[100%] Linking C executable ../../bin/bsmem
Undefined symbols for architecture x86_64:
  "_mecopy_", referenced from:
      _icf_ in bsmemf.f.o
      _tricf_ in bsmemf.f.o
  "_meinit_", referenced from:
      _bsmem in bsmem.c.o
  "_mem4_", referenced from:
      _bsmem in bsmem.c.o
  "_memset_", referenced from:
      _bsmem in bsmem.c.o
  "_meswap_", referenced from:
      _udiag_ in bsmemf.f.o
  "_movie4_", referenced from:
      _bsmem in bsmem.c.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: * [../bin/bsmem] Error 1
make[1]: * [src/CMakeFiles/bsmem.dir/all] Error 2
code-block

What is the best thing to do to make it build in x86_64 architecture?
Any suggestion would be welcome.
Thank you very much,
Youcef.
Depending which Fortran compiler you're using, it may put leading and trailing underscores in the symbol names. If everything compiled correctly, there may be a mismatch in the names
Undefined symbols for architecture x86_64:
 
 
Q