Ah sorry, yes I have done that already.  Sorry for forgetting that 
detail... 

If it should work assuming I have added my new directory in 
source/CMakeLists.txt, maybe my implementation is the problem.  Though, I 
wouldn't know why since it fails at linking.

On Monday, November 9, 2020 at 3:49:21 PM UTC-6 d.arnd...@gmail.com wrote:

> Zachary,
>
> You also need to make sure that CMake actually sees that your new source 
> directory. In particular, you should add a line saying
>
> ADD_SUBDIRECTORY(Test)
>
> to source/CMakeLists.txt.
>
> Best,
> Daniel
>
> Am Mo., 9. Nov. 2020 um 11:35 Uhr schrieb Zachary 42! <
> zachary...@gmail.com>:
>
>> Hi folks,
>>
>> I am trying to add another include/source directory and subsequent obj to 
>> dealii for potential future contributions to dealii.  Though I am having 
>> linking errors because my new obj needs to link agains the lac_obj (need 
>> Trilinos and other interfaces).  I thought the ADD_DEPENDICIES in the 
>> source/CMakeLists.txt file is where this is taking care of but apparently 
>> not.  I am following the exact same CMakeLists.txt files as in the other 
>> source/dirs but I am still getting the undefined symbols error due to 
>> object targets not apparently linking together.
>>
>> [ 80%] Linking CXX shared library ../lib/libdealii.dylib
>> Undefined symbols for architecture x86_64:
>>   "dealii::PETScWrappers::SparseMatrix::SparseMatrix<int>(int const&, 
>> bool)", referenced from:
>>       test::Operator::Operator(int const&) in Operator.cc.o
>>       test::Operator::Operator(int const&, std::__1::basic_string<char, 
>> std::__1::char_traits<char>, std::__1::allocator<char> > const&) in 
>> Operator.cc.o
>> ld: symbol(s) not found for architecture x86_64
>>
>> So looks like the obj_lac needs to link with the obj_test and it doesn’t 
>> appear to be…
>>
>> Here is my source/Test/CMakeLists.txt file which builds fine:
>>
>> INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
>>
>> SET(_src
>>   Operator.cc
>>   )
>>
>> SET(_n_includes_per_unity_file 20)
>>
>> IF(DEAL_II_UNITY_BUILD)
>>   LIST(SORT _unity_include_src)
>> ENDIF()
>>
>> SETUP_SOURCE_LIST("${_unity_include_src}"
>>   "${_separate_src}"
>>   ${_n_includes_per_unity_file}
>>   _src
>>   )
>>
>> FILE(GLOB _header
>>   ${CMAKE_SOURCE_DIR}/include/test/*.h
>>   )
>>
>> DEAL_II_ADD_LIBRARY(obj_test OBJECT ${_src} ${_header})
>>
>> I didn’t change anything in the souce/CMakeLists.txt file.
>>
>> -- 
>> The deal.II project is located at http://www.dealii.org/
>> For mailing list/forum options, see 
>> https://groups.google.com/d/forum/dealii?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "deal.II User Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to dealii+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/dealii/DE13C37A-F916-4295-AE97-685F856C5291%40gmail.com
>> .
>>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/2a6875d0-e597-46ad-9fd3-fa4b24e6ff0cn%40googlegroups.com.

Reply via email to