Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link with correct libraries #8

Conversation

smistad
Copy link
Member

@smistad smistad commented May 18, 2017

This will hopefully link the plugin with the external libraries on windows. FAST_LIBRARIES comes from FASTConfig.cmake and should contain FAST, zlib, OpenCL, ++

@jonei
Copy link
Contributor

jonei commented May 18, 2017

Now there are even more errors of the same type. FAST_LIBRARIES doesn't contain everything we need.
Hardcoding in "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v7.0/lib/x64/OpenCL.lib" in the same place, reduces the amount of errors to the same as before this change. Janne thought it might have something to do with how that string gets parsed, since it is in the FAST CMakeCache.txt file:
//Dependencies for the target
FAST_LIB_DEPENDS:STATIC=blablabla

@jonei
Copy link
Contributor

jonei commented May 19, 2017

Just a thought, can this have anything to do with OpenCL versions? Some of the symbols from the "unresolved external symbol" error messages i pasted i the previous pull request, seems to be used in the OpenCL 1.2 code, which we don't use to compile FAST. We use 1.1 I guess. Which versions of OpenCL and Cuda do you use? We are at Cuda 7.0.

@jonei
Copy link
Contributor

jonei commented May 24, 2017

${OPENCL_LIBRARIES} is still needed in the airways cmakelists
${FAST_LIBRARIES} is not needed
zlibstatic.lib: need to include this in a uniform way on all platforms

Need to handle std::string path; in Config.cpp in FAST. std::string is not working across dlls.

@smistad
Copy link
Member Author

smistad commented May 24, 2017

I'm working on the FAST part of it. Will let you know when I have figured it out

@smistad
Copy link
Member Author

smistad commented May 24, 2017

Ok. Please test the latest commit. I have only tested it on ubuntu. But I am able to build and link the FAST library on windows.

Note that FAST is now built as a shared library on windows (.dll).

@jonei jonei merged commit 8e0b83a into SINTEFMedtek:bugfix/FX-19-airwaysegmentation-algorithm-does-not May 24, 2017
@jonei
Copy link
Contributor

jonei commented May 24, 2017

So this broke the Mac build in 1000 pieces.
24-May-2017 16:59:30 [shell ###] std::atomic m_count;
FAST/Semaphore.hpp:187:10: error: no type named 'atomic' in namespace 'std'
build
Did you change any flags/settings or have you added new code using this C++11 construct? I think we have supported C++11 on Mac before, but I'm not sure.

  1. Windows: Did manage to build everything manually and the airways dll loaded when I added FAST.dll to the path.

@smistad
Copy link
Member Author

smistad commented May 24, 2017

  1. Fast and the airways plugin is built with c++ 11, and it is required. I haven't changed any of that. Will have to look into Mac another day.

  2. Great. Does that mean the windows build is ok? Progress.

@jonei
Copy link
Contributor

jonei commented May 24, 2017

Yes, the windows build seems ok! But the automated tests doesn't run before all platforms are good.

@jonei
Copy link
Contributor

jonei commented May 25, 2017

Mac:
A.
In Cpp11.cmake, C++11 wasn't set for Mac. Don't know if this ever worked for OSX < 10.11 which I use. Please change
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCXX)
to
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" OR CMAKE_COMPILER_IS_GNUCXX)

B.
In Utility.cpp, glFrustum is no longer found after you removed OpenGl, I suppose.
#include <OpenGL/gl.h> made it compile.

@smistad
Copy link
Member Author

smistad commented May 25, 2017

As of CMake 3.0.0 the CMAKE_<LANG>_COMPILER_ID value for Apple-provided Clang is now AppleClang. To test for both the Apple-provided Clang and the regular Clang use the following if condition:

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  # using regular Clang or AppleClang
endif()

https://stackoverflow.com/questions/10046114/in-cmake-how-can-i-test-if-the-compiler-is-clang

I have added this change and the GL include in Utility.cpp to FAST now.

@jonei
Copy link
Contributor

jonei commented May 25, 2017

Everything builds, but the VNNcl tests now seg faults on Linux (14.04). Any ideas?
If you build CustusX, you can try to run Catch from the build folder:
./Catch [unit][vnncl]

Typical output:

error:
SEGFAULT
(
1
)
[16:22:16.655][INFO] --- Initialize services for Catch...
[16:22:16.678][INFO] Installing all plugins...
[16:22:17.904][INFO] Starting plugin org.custusx.registration.gui
[16:22:17.908][INFO] Starting plugin org.custusx.filter.routetotarget
[16:22:17.911][INFO] Starting plugin org.custusx.registration.method.centerline
[16:22:17.913][INFO] Starting plugin org.custusx.acquisition
[16:22:17.915][INFO] Starting plugin org.custusx.help
[16:22:17.921][INFO] Starting plugin org.custusx.core.view
[16:22:18.063][INFO] Layout 0 changed to 3D ACS Connected
[16:22:18.064][INFO] Starting plugin org.custusx.core.state
[16:22:18.067][INFO] Found valid VLC application: /usr/bin/vlc
[16:22:18.068][INFO] Starting plugin org.custusx.registration.method.bronchoscopy
[16:22:18.071][INFO] Starting plugin org.custusx.registration
[16:22:18.072][INFO] Starting plugin org.custusx.core.tracking
[16:22:18.077][INFO] Starting plugin org.custusx.filter.airways
WARNING: NVIDIA platform was detected, disabling OpenGL interop
WARNING: Writing to directly to 3D textures/images is not supported on main device
[16:22:18.122][INFO] Starting plugin org.custusx.filter.accusurf
[16:22:18.125][INFO] Starting plugin org.custusx.core.video
[16:22:18.128][INFO] Starting plugin org.custusx.registration.method.manual
[16:22:18.131][INFO] Starting plugin org.custusx.calibration
[16:22:18.134][INFO] Starting plugin org.custusx.dicom
[16:22:18.137][INFO] Starting plugin org.custusx.filter.tubesegmentation
[16:22:18.141][INFO] Starting plugin org.custusx.training
[16:22:18.146][INFO] Starting plugin org.custusx.core.tracking.system.igstk
[16:22:18.150][INFO] Installing tracking system: org.custusx.core.tracking.system.igstk
[16:22:18.150][INFO] Starting plugin org.custusx.registration.method.commandline
[16:22:18.153][INFO] Starting plugin org.custusx.registration.method.plate
[16:22:18.159][INFO] Starting plugin org.custusx.core.openigtlink
[16:22:18.163][INFO] Installing tracking system: org.custusx.core.openigtlink
[16:22:18.163][INFO] Starting plugin org.custusx.registration.method.pointcloud
[16:22:18.169][INFO] Starting plugin org.custusx.usreconstruction
[16:22:18.173][INFO] Starting plugin org.custusx.registration.method.vessel
[16:22:18.178][INFO] Starting plugin org.custusx.core.patientmodel
[16:22:18.182][INFO] Starting plugin org.custusx.usreconstruction.vnncl
Found 1 OpenCL platforms.
1 platforms selected for inspection.
Platform 0: NVIDIA Corporation
Looking for GPU devices only.
1 devices found for this platform.
Inspecting device 0 with the name Quadro 4000
The device was accepted.
The platform NVIDIA CUDA was selected as the best platform.
A total of 1 devices were selected for the context from this platform:
Device 0: Quadro 4000
[16:22:18.228][INFO] Starting plugin org.custusx.filter.levelset
[16:22:18.232][INFO] Starting plugin org.custusx.usreconstruction.pnn
[16:22:18.236][INFO] Starting plugin org.custusx.registration.method.landmark
[16:22:18.239][DEBUG] --- End initialize services.
Found 1 OpenCL platforms.
1 platforms selected for inspection.
Platform 0: NVIDIA Corporation
Looking for GPU devices only.
1 devices found for this platform.
Inspecting device 0 with the name Quadro 4000
The device was accepted.
The platform NVIDIA CUDA was selected as the best platform.
A total of 1 devices were selected for the context from this platform:
Device 0: Quadro 4000
[16:22:18.285][INFO] Method: 3, radius: 10, planeMethod: 0, nClosePlanes: 8, nPlanes: 21, nStarts: 1
[16:22:18.285][INFO] Kernel path: /media/jenkins/bamboo/buildagent/xml-data/build-dir/CX-CO93-TPL/Installed/CustusX/config//shaders//kernels.cl
Created kernel with name voxel_methods
[16:22:18.291][INFO] Input dims: (21, 21, 21)
[16:22:18.291][INFO] Frames: 21, Blocks: 10, Frames per block: 2
[16:22:18.291][INFO] Allocating 1 big blocks outside of OpenCL
[16:22:18.291][INFO] Allocating 9 small blocks outside of OpenCL
[16:22:18.291][INFO] Allocating OpenCL input block buffers
[16:22:18.291][INFO] Allocating CL output buffer, size 9261
[16:22:18.291][INFO] Using 24276 of 2146631680 global memory
[16:22:18.291][INFO] Device has 49151 bytes of local

@smistad
Copy link
Member Author

smistad commented May 25, 2017

Is this on your machine? Maybe it is due to the upgrade from CUDA 7 to 8. Or it is due to the change we did in OpenCLUtilityLibrary

@jonei
Copy link
Contributor

jonei commented May 25, 2017

No, not mine. The Machine hasn't been touched as far as I know. Maybe OpenCLUtilityLibrary then.

@jonei
Copy link
Contributor

jonei commented May 26, 2017

I had to run all the software updates on the Linux machine and then it worked!
Merging this into the remove tsf/levelset branch and deleting the CX build folder made that branch green as well.

@smistad
Copy link
Member Author

smistad commented May 26, 2017

Great! I have done some improvements in the airways segmentation in FAST, and also added lung sac segmentation to the plugin. Will create a PR for it before the end of the day. Hopefully no build issues this time.

CustusXMachine pushed a commit that referenced this pull request Oct 26, 2017
…ix/FX-31-inncorrect-zoom-after-running-rtt to develop

* commit '94691f3875993f290e774f2dd235a14da810c2ac':
  FX-35: Updated function name.
  FX-15: We need to make sure that the slider changed signal is always triggered to set the camera correctly, in case the slider is already at the same position as the default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants