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

pugixml: correct target name #4135

Merged

Conversation

vicentebolea
Copy link
Collaborator

@vicentebolea vicentebolea commented Apr 4, 2024

fixes: #4081

@vicentebolea vicentebolea changed the base branch from master to release_210 April 4, 2024 17:00
@vicentebolea vicentebolea self-assigned this Apr 4, 2024
@vicentebolea vicentebolea enabled auto-merge April 4, 2024 17:10
@vicentebolea vicentebolea merged commit 10acb04 into ornladios:release_210 Apr 4, 2024
52 of 53 checks passed
@chenrui333
Copy link

still seeing the issue after this patch

[ 87%] Linking CXX executable ../../bin/bpls
cd /tmp/adios2-20240405-47102-70bzk3/ADIOS2-2.10.0/build/source/utils && /opt/homebrew/Cellar/cmake/3.29.1/bin/cmake -E cmake_link_script CMakeFiles/bpls.dir/link.txt --verbose=1
/opt/homebrew/Library/Homebrew/shims/mac/super/clang++ -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/bpls.dir/bpls/bpls.cpp.o -o ../../bin/bpls  ../../lib/libadios2_core.2.10.0.dylib
Undefined symbols for architecture arm64:
  "pugi::xml_document::load_buffer(void const*, unsigned long, unsigned int, pugi::xml_encoding)", referenced from:
      adios2::utils::print_data_xml(char const*, unsigned long) in bpls.cpp.o
  "pugi::xml_document::xml_document()", referenced from:
      adios2::utils::print_data_xml(char const*, unsigned long) in bpls.cpp.o
  "pugi::xml_document::~xml_document()", referenced from:
      adios2::utils::print_data_xml(char const*, unsigned long) in bpls.cpp.o
      adios2::utils::print_data_xml(char const*, unsigned long) in bpls.cpp.o
  "pugi::xml_document::save(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, char const*, unsigned int, pugi::xml_encoding) const", referenced from:
      adios2::utils::print_data_xml(char const*, unsigned long) in bpls.cpp.o
  "pugi::xml_parse_result::operator bool() const", referenced from:
      adios2::utils::print_data_xml(char const*, unsigned long) in bpls.cpp.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@francesco-ballarin
Copy link

francesco-ballarin commented Apr 16, 2024

I had to patch another file as follows (this PR patches source/adios2/toolkit/remote/CMakeLists.txt, but not source/utils/CMakeLists.txt)

diff --git a/source/adios2/toolkit/remote/CMakeLists.txt b/source/adios2/toolkit/remote/CMakeLists.txt
index a739e1a..2128caa 100644
--- a/source/adios2/toolkit/remote/CMakeLists.txt
+++ b/source/adios2/toolkit/remote/CMakeLists.txt
@@ -10,7 +10,7 @@ if (NOT ADIOS2_USE_PIP)
     PRIVATE $<$<PLATFORM_ID:Windows>:shlwapi>)
 
   get_property(pugixml_headers_path
-    TARGET pugixml
+    TARGET adios2::thirdparty::pugixml
     PROPERTY INTERFACE_INCLUDE_DIRECTORIES
   )
 
diff --git a/source/utils/CMakeLists.txt b/source/utils/CMakeLists.txt
index 30dd484..bf57910 100644
--- a/source/utils/CMakeLists.txt
+++ b/source/utils/CMakeLists.txt
@@ -16,7 +16,7 @@ target_link_libraries(bpls
                       PRIVATE $<$<PLATFORM_ID:Windows>:shlwapi>)
 
 get_property(pugixml_headers_path
-  TARGET pugixml
+  TARGET adios2::thirdparty::pugixml
   PROPERTY INTERFACE_INCLUDE_DIRECTORIES
 )
 

to get cmake to run successfully with pugixml provided from debian.

Still, I get a linking error as @chenrui333

/usr/bin/c++ -g -O2 -ffile-prefix-map=/repositories/adios2=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro CMakeFiles/bpls.dir/bpls/bpls.cpp.o -o ../../bin/bpls.serial  ../../lib/x86_64-linux-gnu/libadios2_serial_core.so.2.10.0 -ldl 
/usr/bin/ld: CMakeFiles/bpls.dir/bpls/bpls.cpp.o: undefined reference to symbol '_ZN4pugi12xml_documentD1Ev'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpugixml.so.1: error adding symbols: DSO missing from command line

cc @drew-parsons

@vicentebolea
Copy link
Collaborator Author

@francesco-ballarin can you try this PR #4142

@vicentebolea vicentebolea deleted the fix-pugixml-target-usage branch April 17, 2024 18:24
@francesco-ballarin
Copy link

Thanks @vicentebolea , I will try the PR, most likely this Saturday.

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.

4 participants