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

Sofa linking unsuccesful #175

Closed
oscar93gonmar opened this issue Apr 10, 2017 · 7 comments
Closed

Sofa linking unsuccesful #175

oscar93gonmar opened this issue Apr 10, 2017 · 7 comments

Comments

@oscar93gonmar
Copy link

Hi,
I have updated Tudat and checkout the FullOrbitDetermination branch to use the SOFA package. During the installation the following error appeared: boost libraries not found: "Library not loaded" "Image not found" . I found the solution to the issue in GitHub and I modified the CMake files and now it seems to be properly installed. However, when I call any function in sofaTimeConversions.h I get another issue: symbol(s) not found for architecture x86_64. With the following compile output message:
compile_output
There is an already closed issue with the same error message but it didn't work for me after changing the Cmake configuration-> Cmake_c_compiler:string
Thanks in advance,
Oscar

@DominicDirkx
Copy link
Member

Hi Oscar,

Could you attach in a file:

  • The CMakeLists of your application
  • The full compile output in a .txt file

I think I know what is causing the problem (sofa is not added as a link library in your CMake file) but I want to check to make sure,

Dominic

@DominicDirkx DominicDirkx changed the title symbol(s) not found for architecture x86_64 Sofa linking unsuccesful Apr 11, 2017
@oscar93gonmar
Copy link
Author

Yes I attach them here, sorry I didn't see your message until now.
Thanks, Oscar

compileOutput.txt

CMakeLists.txt

@DominicDirkx
Copy link
Member

Hi Oscar,

Yes, I think my suspicion is correct. First, add Sofa as a library to your project by adding (for instance on line 159 after including spice):

option(USE_SOFA "build Tudat with Sofa enabled" ON) # OFF is the default
if(NOT USE_SOFA)
message(STATUS "SOFA disabled!")
add_definitions(-DUSE_SOFA=0)
else()
message(STATUS "SOFA enabled!")
add_definitions(-DUSE_SOFA=1)

Find SOFA library on local system.

find_package(Sofa)

Include Sofa directories.

if(NOT APPLE OR APPLE_INCLUDE_FORCE)
include_directories(SYSTEM AFTER "${SOFA_INCLUDE_DIR}")
else( )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem "${SOFA_INCLUDE_DIR}"")
endif( )
endif()

Then add:

if(USE_SOFA)
list(APPEND TUDAT_EXTERNAL_LIBRARIES tudat_sofa_interface sofa)
list(APPEND TUDAT_ESTIMATION_LIBRARIES tudat_sofa_interface sofa)
endif()

Let me know if this works out,

Best regards,

Dominic

@oscar93gonmar
Copy link
Author

Hi Dominic,
After doing it, I am getting an error saying that: including_directories given empty-string as include directory. I attach the compile output
compile_output.txt

thanks for your help,
Oscar

@DominicDirkx
Copy link
Member

Your applications folder should have a 'CMakeModules' directory somewhere. I'm guessing that it doesn't contain a FindSofa.cmake file. You can copy this file from tudatBundle/external/CMake to the CMakeModules directory of your application. Let me know if this resolves it,

Dominic

@oscar93gonmar
Copy link
Author

Thanks!!! now it is working
Thank you very much,
Oscar

@DominicDirkx
Copy link
Member

Great!

DominicDirkx added a commit to DominicDirkx/tudat that referenced this issue Sep 27, 2024
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

No branches or pull requests

2 participants