<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hello Longzhu,
<div class=""><br class="">
</div>
<div class="">We have address the issue in ITK:</div>
<div class=""><a href="http://review.source.kitware.com/#/c/22080/" class="">http://review.source.kitware.com/#/c/22080/</a></div>
<div class=""><br class="">
</div>
<div class="">And updated the SimpleITK master branch to use this patched version of ITK. You may need to do a "git checkout master && git pull"</div>
<div class=""><br class="">
</div>
<div class="">If you checkout the current SimpleITK master, I expect that is should just compile and build with the default options. However, to ensure it works I’d recommend the following initial configuration line:</div>
<div class=""><br class="">
</div>
<div class="">$ cmake -DITK_DYNAMIC_LOADING:BOOL=0 -DCMAKE_DL_LIBS=“” ../SimpleITK/SuperBuild </div>
<div class=""><br class="">
</div>
<div class="">That should work for you now. Please give it a try and report back.</div>
<div class=""><br class="">
</div>
<div class="">Thanks for trying out SimpleITK!</div>
<div class="">Brad</div>
<div class=""><br class="">
</div>
<div class="">
<blockquote type="cite" class="">
<blockquote type="cite" class="">
<blockquote type="cite" class="">
<blockquote type="cite" class=""> cmake ../SuperBuild -DITK_DYNAMIC_LOADING:BOOL=0</blockquote>
</blockquote>
</blockquote>
</blockquote>
</div>
<div class=""><br class="">
</div>
<div class="">
<div>
<blockquote type="cite" class="">
<div class="">On Feb 15, 2017, at 6:52 AM, Lowekamp, Bradley (NIH/NLM/LHC) [C] <<a href="mailto:blowekamp@mail.nih.gov" class="">blowekamp@mail.nih.gov</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">It looks like our e-mails crossed last night.<br class="">
<br class="">
I think you were really close to building building SimpleITK. If your goal is to use the SimpleITK language binding I would recommend continuing to use the SimpleITK superbuild. From your previous message the Superbuild compiled all of ITK, and the SimpleITK
libraries, and maybe even the SimpleITK testing too. It just appears to have failed on linking for the Tcl wrapping.<br class="">
<br class="">
When you do the Superbuild of SimpleITK it automatically downloads the correct version of ITK, and compiles it with the correct options to build with SimpleITK.<br class="">
<br class="">
My recommendation to to verify that the core SimpleITK libraries are being built correctly and that the SimpleITK testing drivers get linked OK. If this is the case it tells us there is something not right with the way the linking is done for the wrapping and
we need to closely look at that command line and the options CMake has.<br class="">
<br class="">
HTH,<br class="">
Brad<br class="">
<br class="">
<blockquote type="cite" class="">On Feb 14, 2017, at 9:24 PM, Longzhu Shen <<a href="mailto:lqshen10@gmail.com" class="">lqshen10@gmail.com</a>> wrote:<br class="">
<br class="">
<br class="">
Hi Brad and Matt,<br class="">
<br class="">
Many thanks for the kind advice. I'm very new to ITK. Some of my<br class="">
questions may be naive. I hope you could bear with me. I really hope to<br class="">
get it working if I could. Thank you very much. <br class="">
<br class="">
I checked out the freebsd port but I could not install it. (errors below)<br class="">
<br class="">
Then I went back to the ITK src (I mistakenly thought simpleITK contains<br class="">
ITK before) and tried to follow the manual to install it.<br class="">
<br class="">
The cmake was fine for the most part but some errors did appear (<br class="">
attached). Assuming those errors were not fatal, I<br class="">
proceeded with make. The program stopped at the line below. <br class="">
<br class="">
make[2]: don't know how to make ExternalData/Testing/Data/Input/MetaIO/Small\. Stop<br class="">
<br class="">
It is the same error when I tried to compile from the ports. <br class="">
<br class="">
Wondering whether I can seek some insight here or it is hopeless with<br class="">
freebsd by this point. Thanks for advice.<br class="">
<br class="">
sincerely,<br class="">
<br class="">
Longzhu<br class="">
<br class="">
<cmake_err.log><br class="">
<br class="">
<br class="">
Matt McCormick @ 2017-02-14 21:48 UTC:<br class="">
<br class="">
<blockquote type="cite" class="">Hi,<br class="">
<br class="">
It is not likely that the errors are related to ITK_DYNAMIC_LOADING.<br class="">
<br class="">
FreeBSD has a package for ITK, which gives its configuration:<br class="">
<br class="">
<a href="https://www.freshports.org/science/InsightToolkit/" class="">https://www.freshports.org/science/InsightToolkit/</a><br class="">
https://reviews.freebsd.org/diffusion/P/browse/head/science/InsightToolkit/Makefile<br class="">
<br class="">
HTH,<br class="">
Matt<br class="">
<br class="">
On Tue, Feb 14, 2017 at 4:32 PM, Lowekamp, Bradley (NIH/NLM/LHC) [C]<br class="">
<blowekamp@mail.nih.gov> wrote:<br class="">
<blockquote type="cite" class="">Hi,<br class="">
<br class="">
Are we sure the first case was not close to mostly working? Did other<br class="">
wrapped language link OK? did SimpleITK tests link OK? If ITK tests are<br class="">
enable with ITK_DYNAMIC_LOADING:BOOL=0 do they compile and work? We need to<br class="">
know if ITK is OK before moving to SimpleITK.<br class="">
<br class="">
@Matt<br class="">
I am not very familiar with CMAKE_DL_LIBS either [1]. I know Matt added the<br class="">
ITK_DYNAMIC_LOADING CMake variable to ITK, so he may have insight into this<br class="">
problem too. My guess is that CMAKE_DL_LIBS variable is not entered into the<br class="">
cache but CMake provides a default value for platform. I expect you can<br class="">
overrride it with command line values.<br class="">
<br class="">
I hacked a patch to enable CMAKE_DL_LIBS to propgate down from the<br class="">
Superbuild [2]. If you checkout that path you should be able to do a<br class="">
supberbuild of -DCMAKE_DL_LIBS=“”. That may work, but I don’t know for sure.<br class="">
<br class="">
HTH,<br class="">
Brad<br class="">
<br class="">
[1] https://cmake.org/cmake/help/v3.0/variable/CMAKE_DL_LIBS.html<br class="">
[2] https://github.com/SimpleITK/SimpleITK/pull/104<br class="">
<br class="">
<br class="">
On Feb 14, 2017, at 3:53 PM, Longzhu Shen <lqshen10@gmail.com> wrote:<br class="">
<br class="">
Hi Brad,<br class="">
<br class="">
Many thanks for the advice.<br class="">
I made an attempt to follow the first approach but it did not seem<br class="">
work. Here is what I did and the errors I got.<br class="">
<br class="">
-----------------------------------------------------<br class="">
$ cmake ../SuperBuild -DITK_DYNAMIC_LOADING:BOOL=0<br class="">
<br class="">
<br class="">
[ 80%] Building CXX object<br class="">
Wrapping/Python/CMakeFiles/SimpleITK_PYTHON.dir/sitkPyCommand.cxx.o<br class="">
[ 80%] Building CXX object<br class="">
Wrapping/Python/CMakeFiles/SimpleITK_PYTHON.dir/SimpleITKPYTHON_wrap.cxx.o<br class="">
[ 80%] Linking CXX executable bin/SimpleITKTclsh<br class="">
/usr/bin/ld: cannot find -ldl<br class="">
c++: error: linker command failed with exit code 1 (use -v to see<br class="">
invocation)<br class="">
--- Wrapping/Tcl/bin/SimpleITKTclsh ---<br class="">
*** [Wrapping/Tcl/bin/SimpleITKTclsh] Error code 1<br class="">
-----------------------------------------------------<br class="">
<br class="">
I planned to try the 2nd approach. However, I could not find the<br class="">
CMAKE_DL_LIBS easily. I checked the subfolder of Superbuild,<br class="">
and SimpleITK-build/ITK-build. I did not find it in<br class="">
Code/Common/src/CMakeLists.txt as well.<br class="">
<br class="">
The only place I found "CMAKE_DL_LIBS" is in the file<br class="">
CMake/sitkTargetLinkLibrariesWithDynamicLookup.cmake<br class="">
<br class="">
279: target_link_libraries(main \"${CMAKE_DL_LIBS}\")<br class="">
<br class="">
I was wondering I may get further directions to modify CMAKE_DL_LIBS<br class="">
variable. Many thanks.<br class="">
<br class="">
sincerely,<br class="">
<br class="">
Longzhu<br class="">
<br class="">
<br class="">
Lowekamp @ 2017-02-14 15:36 UTC:<br class="">
<br class="">
Hello Longzu,<br class="">
<br class="">
You are using freebsd, that is new and exciting. I have not used that OS for<br class="">
developing.<br class="">
<br class="">
There are two things in the ITK/SimpleITK build that are related to this.<br class="">
<br class="">
First, there is an option in ITK ( which I have not used ) call<br class="">
ITK_DYNAMIC_LOADING. If you pass -DITK_DYNAMIC_LOADING:BOOL=0 to cmake for<br class="">
the Superbuild, it should propagate to the ITK project and this feature will<br class="">
be remove. This may solve your problem.<br class="">
<br class="">
The second is CMake variable CMAKE_DL_LIBS. I believe it is the dl library<br class="">
that is causing the problem [1]. Setting it to an empty string may also<br class="">
remove it from the linking lines. Getting that to propagate to the ITK<br class="">
project will not happen automatically and would need to be done manually in<br class="">
the ITK build.<br class="">
<br class="">
HTH,<br class="">
Brad<br class="">
<br class="">
[1]<br class="">
https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/Common/src/CMakeLists.txt#L142<br class="">
<br class="">
________________________________________<br class="">
From: Longzhu Shen [lqshen10@gmail.com]<br class="">
Sent: Tuesday, February 14, 2017 9:11 AM<br class="">
To: community@itk.org<br class="">
Subject: [ITK] compiling itk on freebsd, how to flag out ldl?<br class="">
<br class="">
Hello,<br class="">
<br class="">
I'm trying to compile simpleitk on my freebsd system.<br class="">
The issue I encountered is ldl is not found.<br class="">
After some searching, I found libdl is not needed on freebsd. It is<br class="">
included in libc. Wondering how I can turn it off in the make file.<br class="">
I did not find ldl in the Makefile under Simpleitk-build.<br class="">
<br class="">
I followed the instrutions from the link below.<br class="">
<br class="">
https://chsasank.github.io/sitk-docs/building/unix.html#obtaining-source-code<br class="">
<br class="">
Thanks.<br class="">
<br class="">
Longzhu<br class="">
<br class="">
<br class="">
<br class="">
--<br class="">
Longzhu Shen, Ph.D.<br class="">
Postdoc Research Associate<br class="">
School of Forestry and Environmental Studies<br class="">
Yale University<br class="">
195 Prospect Street<br class="">
New Haven, CT 06511<br class="">
<br class="">
<br class="">
</blockquote>
</blockquote>
<br class="">
<br class="">
-- <br class="">
Longzhu Shen, Ph.D.<br class="">
Postdoc Research Associate<br class="">
School of Forestry and Environmental Studies<br class="">
Yale University<br class="">
195 Prospect Street<br class="">
New Haven, CT 06511<br class="">
</blockquote>
<br class="">
_______________________________________________<br class="">
Community mailing list<br class="">
<a href="mailto:Community@itk.org" class="">Community@itk.org</a><br class="">
http://public.kitware.com/mailman/listinfo/community<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>