BIC-MNI / minc-toolkit-v2

Version 2 of the minc-toolkit, uses tools based on ITK version 4.x
GNU General Public License v3.0
49 stars 21 forks source link

cmake fails on master branch #137

Closed SaibotMagd closed 3 years ago

SaibotMagd commented 3 years ago

Hi I try to install minc-toolkit for weeks. I'm neither a programmer nor a linux expert, so it's a very frustrating experience. At this point I can't even find a hint where the error come from. Here the log after the standard cmake command you provided in the install-pipeline (it's an prior used new installed ubuntu 20 lts system):


Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_9f62e/fast && /usr/bin/make -f CMakeFiles/cmTC_9f62e.dir/build.make CMakeFiles/cmTC_9f62e.dir/build
make[1]: Entering directory '/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_9f62e.dir/src.c.o
/usr/bin/cc   -DCMAKE_HAVE_LIBC_PTHREAD -fPIE   -o CMakeFiles/cmTC_9f62e.dir/src.c.o   -c /home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_9f62e
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_9f62e.dir/link.txt --verbose=1
/usr/bin/cc  -DCMAKE_HAVE_LIBC_PTHREAD    CMakeFiles/cmTC_9f62e.dir/src.c.o  -o cmTC_9f62e 
/usr/bin/ld: CMakeFiles/cmTC_9f62e.dir/src.c.o: in function `main':
src.c:(.text+0x46): undefined reference to `pthread_create'
/usr/bin/ld: src.c:(.text+0x52): undefined reference to `pthread_detach'
/usr/bin/ld: src.c:(.text+0x63): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_9f62e.dir/build.make:87: cmTC_9f62e] Error 1
make[1]: Leaving directory '/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_9f62e/fast] Error 2

Source file was:
#include <pthread.h>

void* test_func(void* data)
{
  return data;
}

int main(void)
{
  pthread_t thread;
  pthread_create(&thread, NULL, test_func, NULL);
  pthread_detach(thread);
  pthread_join(thread, NULL);
  pthread_atfork(NULL, NULL, NULL);
  pthread_exit(NULL);

  return 0;
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_71bff/fast && /usr/bin/make -f CMakeFiles/cmTC_71bff.dir/build.make CMakeFiles/cmTC_71bff.dir/build
make[1]: Entering directory '/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_71bff.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create -fPIE   -o CMakeFiles/cmTC_71bff.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.16/Modules/CheckFunctionExists.c
Linking C executable cmTC_71bff
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_71bff.dir/link.txt --verbose=1
/usr/bin/cc  -DCHECK_FUNCTION_EXISTS=pthread_create    CMakeFiles/cmTC_71bff.dir/CheckFunctionExists.c.o  -o cmTC_71bff  -lpthreads 
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_71bff.dir/build.make:87: cmTC_71bff] Error 1
make[1]: Leaving directory '/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_71bff/fast] Error 2

Determining if files sys/ndir.h exist failed with the following output:
Change Dir: /home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_48be4/fast && /usr/bin/make -f CMakeFiles/cmTC_48be4.dir/build.make CMakeFiles/cmTC_48be4.dir/build
make[1]: Entering directory '/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_48be4.dir/HAVE_SYS_NDIR_H.c.o
/usr/bin/cc   -fPIC  -fPIE   -o CMakeFiles/cmTC_48be4.dir/HAVE_SYS_NDIR_H.c.o   -c /home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CheckIncludeFiles/HAVE_SYS_NDIR_H.c
/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CheckIncludeFiles/HAVE_SYS_NDIR_H.c:2:10: fatal error: sys/ndir.h: No such file or directory
    2 | #include <sys/ndir.h>
      |          ^~~~~~~~~~~~
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_48be4.dir/build.make:66: CMakeFiles/cmTC_48be4.dir/HAVE_SYS_NDIR_H.c.o] Error 1
make[1]: Leaving directory '/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_48be4/fast] Error 2

Source:
/* */
#include <sys/ndir.h>

int main(void){return 0;}

Determining if files vfork.h exist failed with the following output:
Change Dir: /home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_74aa0/fast && /usr/bin/make -f CMakeFiles/cmTC_74aa0.dir/build.make CMakeFiles/cmTC_74aa0.dir/build
make[1]: Entering directory '/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_74aa0.dir/HAVE_VFORK_H.c.o
/usr/bin/cc   -fPIC  -fPIE   -o CMakeFiles/cmTC_74aa0.dir/HAVE_VFORK_H.c.o   -c /home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CheckIncludeFiles/HAVE_VFORK_H.c
/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CheckIncludeFiles/HAVE_VFORK_H.c:2:10: fatal error: vfork.h: No such file or directory
    2 | #include <vfork.h>
      |          ^~~~~~~~~
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_74aa0.dir/build.make:66: CMakeFiles/cmTC_74aa0.dir/HAVE_VFORK_H.c.o] Error 1
make[1]: Leaving directory '/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_74aa0/fast] Error 2

Source:
/* */
#include <vfork.h>

int main(void){return 0;}

Determining if the function isfinite exists failed with the following output:
Change Dir: /home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_07cd2/fast && /usr/bin/make -f CMakeFiles/cmTC_07cd2.dir/build.make CMakeFiles/cmTC_07cd2.dir/build
make[1]: Entering directory '/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_07cd2.dir/CheckFunctionExists.c.o
/usr/bin/cc   -fPIC -DCHECK_FUNCTION_EXISTS=isfinite -fPIE   -o CMakeFiles/cmTC_07cd2.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.16/Modules/CheckFunctionExists.c
Linking C executable cmTC_07cd2
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_07cd2.dir/link.txt --verbose=1
/usr/bin/cc  -fPIC -DCHECK_FUNCTION_EXISTS=isfinite    -rdynamic CMakeFiles/cmTC_07cd2.dir/CheckFunctionExists.c.o  -o cmTC_07cd2 
/usr/bin/ld: CMakeFiles/cmTC_07cd2.dir/CheckFunctionExists.c.o: in function `main':
CheckFunctionExists.c:(.text+0x14): undefined reference to `isfinite'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_07cd2.dir/build.make:87: cmTC_07cd2] Error 1
make[1]: Leaving directory '/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_07cd2/fast] Error 2

Determining if files complex exist failed with the following output:
Change Dir: /home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_f8a7d/fast && /usr/bin/make -f CMakeFiles/cmTC_f8a7d.dir/build.make CMakeFiles/cmTC_f8a7d.dir/build
make[1]: Entering directory '/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_f8a7d.dir/HAVE_COMPLEX.c.o
/usr/bin/cc   -fPIC  -fPIE   -o CMakeFiles/cmTC_f8a7d.dir/HAVE_COMPLEX.c.o   -c /home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CheckIncludeFiles/HAVE_COMPLEX.c
/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CheckIncludeFiles/HAVE_COMPLEX.c:2:10: fatal error: complex: No such file or directory
    2 | #include <complex>
      |          ^~~~~~~~~
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_f8a7d.dir/build.make:66: CMakeFiles/cmTC_f8a7d.dir/HAVE_COMPLEX.c.o] Error 1
make[1]: Leaving directory '/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_f8a7d/fast] Error 2

Source:
/* */
#include <complex>

int main(void){return 0;}

Determining if the function cbrt exists failed with the following output:
Change Dir: /home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_206f5/fast && /usr/bin/make -f CMakeFiles/cmTC_206f5.dir/build.make CMakeFiles/cmTC_206f5.dir/build
make[1]: Entering directory '/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_206f5.dir/CheckFunctionExists.c.o
/usr/bin/cc   -fPIC -DCHECK_FUNCTION_EXISTS=cbrt -fPIE   -o CMakeFiles/cmTC_206f5.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.16/Modules/CheckFunctionExists.c
<command-line>: warning: conflicting types for built-in function ‘cbrt’; expected ‘double(double)’ [-Wbuiltin-declaration-mismatch]
/usr/share/cmake-3.16/Modules/CheckFunctionExists.c:7:3: note: in expansion of macro ‘CHECK_FUNCTION_EXISTS’
    7 |   CHECK_FUNCTION_EXISTS(void);
      |   ^~~~~~~~~~~~~~~~~~~~~
/usr/share/cmake-3.16/Modules/CheckFunctionExists.c:1:1: note: ‘cbrt’ is declared in header ‘<math.h>’
  +++ |+#include <math.h>
    1 | #ifdef CHECK_FUNCTION_EXISTS
Linking C executable cmTC_206f5
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_206f5.dir/link.txt --verbose=1
/usr/bin/cc  -fPIC -DCHECK_FUNCTION_EXISTS=cbrt    -rdynamic CMakeFiles/cmTC_206f5.dir/CheckFunctionExists.c.o  -o cmTC_206f5 
/usr/bin/ld: CMakeFiles/cmTC_206f5.dir/CheckFunctionExists.c.o: in function `main':
CheckFunctionExists.c:(.text+0x14): undefined reference to `cbrt'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_206f5.dir/build.make:87: cmTC_206f5] Error 1
make[1]: Leaving directory '/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_206f5/fast] Error 2

Determining if the function gamma exists failed with the following output:
Change Dir: /home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_570da/fast && /usr/bin/make -f CMakeFiles/cmTC_570da.dir/build.make CMakeFiles/cmTC_570da.dir/build
make[1]: Entering directory '/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_570da.dir/CheckFunctionExists.c.o
/usr/bin/cc   -fPIC -DCHECK_FUNCTION_EXISTS=gamma -fPIE   -o CMakeFiles/cmTC_570da.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.16/Modules/CheckFunctionExists.c
<command-line>: warning: conflicting types for built-in function ‘gamma’; expected ‘double(double)’ [-Wbuiltin-declaration-mismatch]
/usr/share/cmake-3.16/Modules/CheckFunctionExists.c:7:3: note: in expansion of macro ‘CHECK_FUNCTION_EXISTS’
    7 |   CHECK_FUNCTION_EXISTS(void);
      |   ^~~~~~~~~~~~~~~~~~~~~
Linking C executable cmTC_570da
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_570da.dir/link.txt --verbose=1
/usr/bin/cc  -fPIC -DCHECK_FUNCTION_EXISTS=gamma    -rdynamic CMakeFiles/cmTC_570da.dir/CheckFunctionExists.c.o  -o cmTC_570da 
/usr/bin/ld: CMakeFiles/cmTC_570da.dir/CheckFunctionExists.c.o: in function `main':
CheckFunctionExists.c:(.text+0x14): undefined reference to `gamma'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_570da.dir/build.make:87: cmTC_570da] Error 1
make[1]: Leaving directory '/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_570da/fast] Error 2

Determining if files limit.h exist failed with the following output:
Change Dir: /home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_0178c/fast && /usr/bin/make -f CMakeFiles/cmTC_0178c.dir/build.make CMakeFiles/cmTC_0178c.dir/build
make[1]: Entering directory '/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_0178c.dir/HAVE_LIMITS_H.c.o
/usr/bin/cc   -fPIC   -fPIE   -o CMakeFiles/cmTC_0178c.dir/HAVE_LIMITS_H.c.o   -c /home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CheckIncludeFiles/HAVE_LIMITS_H.c
/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CheckIncludeFiles/HAVE_LIMITS_H.c:2:10: fatal error: limit.h: No such file or directory
    2 | #include <limit.h>
      |          ^~~~~~~~~
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_0178c.dir/build.make:66: CMakeFiles/cmTC_0178c.dir/HAVE_LIMITS_H.c.o] Error 1
make[1]: Leaving directory '/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_0178c/fast] Error 2

Source:
/* */
#include <limit.h>

int main(void){return 0;}

Determining if the function alloca exists failed with the following output:
Change Dir: /home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_04fb1/fast && /usr/bin/make -f CMakeFiles/cmTC_04fb1.dir/build.make CMakeFiles/cmTC_04fb1.dir/build
make[1]: Entering directory '/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_04fb1.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=alloca -fPIE   -o CMakeFiles/cmTC_04fb1.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.16/Modules/CheckFunctionExists.c
<command-line>: warning: conflicting types for built-in function ‘alloca’; expected ‘void *(long unsigned int)’ [-Wbuiltin-declaration-mismatch]
/usr/share/cmake-3.16/Modules/CheckFunctionExists.c:7:3: note: in expansion of macro ‘CHECK_FUNCTION_EXISTS’
    7 |   CHECK_FUNCTION_EXISTS(void);
      |   ^~~~~~~~~~~~~~~~~~~~~
Linking C executable cmTC_04fb1
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_04fb1.dir/link.txt --verbose=1
/usr/bin/cc  -DCHECK_FUNCTION_EXISTS=alloca    -rdynamic CMakeFiles/cmTC_04fb1.dir/CheckFunctionExists.c.o  -o cmTC_04fb1 
/usr/bin/ld: CMakeFiles/cmTC_04fb1.dir/CheckFunctionExists.c.o: in function `main':
CheckFunctionExists.c:(.text+0x23): undefined reference to `alloca'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_04fb1.dir/build.make:87: cmTC_04fb1] Error 1
make[1]: Leaving directory '/home/saibotmagd/minc-toolkit-v2/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_04fb1/fast] Error 2
SaibotMagd commented 3 years ago

I just guessed and found out that "gsl-2.4.tar.gz" wasn't downloaded at all (filesize 0). So I downloaded it manually and put it into the cache folder. Now the cmake command execute without error.

vfonov commented 3 years ago

Hi I try to install minc-toolkit for weeks. I'm neither a programmer nor a linux expert, so it's a very frustrating experience.

Why don't you install pre-built binaries from http://bic-mni.github.io/ then?

SaibotMagd commented 3 years ago

Hi I try to install minc-toolkit for weeks. I'm neither a programmer nor a linux expert, so it's a very frustrating experience.

Why don't you install pre-built binaries from http://bic-mni.github.io/ then?

I tried but it isn't working. Also with a long list of errors, they could have something to do with the path environment.

But thank you for the hint. I downloaded the binary, unpacked it and set the path-variables manuelly and now it seems to work.