smistad / FAST

A framework for high-performance medical image processing, neural network inference and visualization
https://fast.eriksmistad.no
BSD 2-Clause "Simplified" License
441 stars 102 forks source link

Issue with compiling FAST with tests #119

Closed shayandoust closed 5 years ago

shayandoust commented 5 years ago

Hello there,

I am having some troubles compiling FAST with FAST_BUILD_TESTS set to on. I am currently packaging this software1 within debian and at this stage this is incomplete. I have tested this on two systems within chroot / clean environments.

The output is as follows during the linking process:

...
[100%] Linking CXX executable bin/testFAST
/usr/bin/ld: CMakeFiles/testFAST.dir/source/FAST/Algorithms/NeuralNetwork/VolumeTests.cpp.o: in function `____C_A_T_C_H____T_E_S_T____32()':
VolumeTests.cpp:(.text+0x2e4): undefined reference to `fast::PatchGenerator::PatchGenerator()'
/usr/bin/ld: VolumeTests.cpp:(.text+0x3bc): undefined reference to `fast::PatchGenerator::setPatchSize(int, int, int)'
/usr/bin/ld: VolumeTests.cpp:(.text+0x766): undefined reference to `fast::PatchStitcher::PatchStitcher()'
/usr/bin/ld: CMakeFiles/testFAST.dir/source/FAST/Algorithms/NeuralNetwork/VolumeTests.cpp.o: in function `fast::PatchStitcher::~PatchStitcher()':
VolumeTests.cpp:(.text._ZN4fast13PatchStitcherD2Ev[_ZN4fast13PatchStitcherD5Ev]+0x3): undefined reference to `vtable for fast::PatchStitcher'
/usr/bin/ld: CMakeFiles/testFAST.dir/source/FAST/Algorithms/NeuralNetwork/VolumeTests.cpp.o: in function `fast::PatchStitcher::~PatchStitcher()':
VolumeTests.cpp:(.text._ZN4fast13PatchStitcherD0Ev[_ZN4fast13PatchStitcherD5Ev]+0x3): undefined reference to `vtable for fast::PatchStitcher'
/usr/bin/ld: CMakeFiles/testFAST.dir/source/FAST/Algorithms/NeuralNetwork/VolumeTests.cpp.o: in function `____C_A_T_C_H____T_E_S_T____32() [clone .cold.249]':
VolumeTests.cpp:(.text.unlikely+0x99): undefined reference to `fast::PatchGenerator::~PatchGenerator()'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/testFAST.dir/build.make:977: bin/testFAST] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/testFAST.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Hence, I am unsure what I am doing wrong as I have all of the dependencies installed and recommendation to the right path would be much appreciated!

Many thanks, Shayan

smistad commented 5 years ago

Hi Shayan

I believe this error was introduced when I recently added the WholeSlideImaging module which is set to OFF by default atm.

You can try and test if this is the issue by setting the cmake flag FAST_MODULE_WholeSlideImaging to ON and then try and compile the tests again. Note that you then also need the openslide library installed on your system:

sudo apt install libopenslide0 libopenslide-dev

I will commit a fix for this error asap

shayandoust commented 5 years ago

Hello Smistad,

Thanks for your reply. Setting that cmake option as true does in fact build the tests successfully. This is useful for autopkgtest for package quality assurance.

smistad commented 5 years ago

Great!