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

cons: fix for multiple include dirs returned by xml2-config #497

Merged
merged 2 commits into from
Mar 11, 2023

Conversation

plexoos
Copy link
Member

@plexoos plexoos commented Feb 24, 2023

xml2-config --cflags may return multiple paths in which case cons
expects them to be separated by ':'

xml2-config --cflags may return multiple paths in which case cons
expects them to be separated by ':'
mgr/ConsDefs.pm Outdated Show resolved Hide resolved
@plexoos
Copy link
Member Author

plexoos commented Feb 26, 2023

Here are some more details on what's being fixed and why. Building on a rcas node with the STAR's csh login scripts failed for me with the following error:

$ starver dev config/v0.2.3-rhel7-root5.34.38-32b
$ cons +StDbLib
....
g++ -m32 -fPIC -pipe -Wall -Woverloaded-virtual -std=c++0x -Wno-long-long -pthread -Wno-deprecated-declarations -g -Dsl73_gcc485 -D__ROOT__ -DNEW_DAQ_READER -I. -IStRoot -I.sl73_gcc485/include -I/afs/rhic.bnl.gov/star/packages/DEV -I/afs/rhic.bnl.gov/star/packages/DEV/StRoot -I/afs/rhic.bnl.gov/star/packages/DEV/.sl73_gcc485/include -I/cvmfs/star.sdcc.bnl.gov/star-spack/spack/opt/spack/linux-rhel7-x86/gcc-4.8.5/root-5.34.38-iohvmc4ws6ykoeqo26brhlaf5fdeq5jz/include -I/cvmfs/star.sdcc.bnl.gov/star-spack/spack/opt/spack/linux-rhel7-x86/gcc-4.8.5/mysql-5.6.43-l53d4b6d4hx44oqovuc27nnetbjp2ybo/include -c .sl73_gcc485/obj/StRoot/StDbLib/MysqlDb.cc -o .sl73_gcc485/obj/StRoot/StDbLib/MysqlDb.o
In file included from .sl73_gcc485/obj/StRoot/StDbLib/StDbServiceBroker.h:22:0,
                 from .sl73_gcc485/obj/StRoot/StDbLib/StDbManagerImpl.hh:72,
                 from .sl73_gcc485/obj/StRoot/StDbLib/MysqlDb.h:154,
                 from .sl73_gcc485/obj/StRoot/StDbLib/MysqlDb.cc:272:
.sl73_gcc485/obj/StRoot/StDbLib/StlXmlTree.h:3:30: fatal error: libxml/xmlreader.h: No such file or directory
 #include <libxml/xmlreader.h>
                              ^
compilation terminated.

Apparently, the include dirs for libxml2 are missing, although the build log shows the expected value for $XMLINCDIR:

#10 1.017 Using /opt/software/linux-scientific7-x86_64/gcc-4.8.5/libxml2-2.9.13-bcnwcywvldxfk3lgq2kosswuuomjr3fn/bin/xml2-config
#10 1.017 	XMLLIBDIR = /opt/software/linux-scientific7-x86_64/gcc-4.8.5/libxml2-2.9.13-bcnwcywvldxfk3lgq2kosswuuomjr3fn/lib
#10 1.017 	XMLINCDIR = /opt/software/linux-scientific7-x86_64/gcc-4.8.5/libxml2-2.9.13-bcnwcywvldxfk3lgq2kosswuuomjr3fn/include/libxml2 -I/opt/software/linux-scientific7-x86_64/gcc-4.8.5/libiconv-1.16-fdvezl2dsxavxucpwqvya2klfxlu7na2/include
#10 1.017 	XMLLIBS = -lxml2 -L/opt/software/linux-scientific7-x86_64/gcc-4.8.5/zlib-1.2.12-4z3ybgoz3vlkmxd4mk37grmzbuoifusb/lib -lz -L/opt/software/linux-scientific7-x86_64/gcc-4.8.5/xz-5.2.5-2edpl3mylaok7qd3i4u3hw33rtkstoqp/lib -llzma -L/opt/software/linux-scientific7-x86_64/gcc-4.8.5/libiconv-1.16-fdvezl2dsxavxucpwqvya2klfxlu7na2/lib -liconv -lm -ldl
#10 1.017 	XMLCPPFlag = 

This is similar to the output in the containers but it does not cause the same problem. Not sure if it matters here but in the containers we use bash and an older version of perl...

After the fix the code can be compiled and the cons' output looks like this:

#10 1.276 Using /opt/software/linux-scientific7-x86_64/gcc-4.8.5/libxml2-2.9.13-bcnwcywvldxfk3lgq2kosswuuomjr3fn/bin/xml2-config
#10 1.276 	XMLLIBDIR = /opt/software/linux-scientific7-x86_64/gcc-4.8.5/libxml2-2.9.13-bcnwcywvldxfk3lgq2kosswuuomjr3fn/lib
#10 1.276 	XMLINCDIR = /opt/software/linux-scientific7-x86_64/gcc-4.8.5/libxml2-2.9.13-bcnwcywvldxfk3lgq2kosswuuomjr3fn/include/libxml2:/opt/software/linux-scientific7-x86_64/gcc-4.8.5/libiconv-1.16-fdvezl2dsxavxucpwqvya2klfxlu7na2/include
#10 1.276 	XMLLIBS = -lxml2 -L/opt/software/linux-scientific7-x86_64/gcc-4.8.5/zlib-1.2.12-4z3ybgoz3vlkmxd4mk37grmzbuoifusb/lib -lz -L/opt/software/linux-scientific7-x86_64/gcc-4.8.5/xz-5.2.5-2edpl3mylaok7qd3i4u3hw33rtkstoqp/lib -llzma -L/opt/software/linux-scientific7-x86_64/gcc-4.8.5/libiconv-1.16-fdvezl2dsxavxucpwqvya2klfxlu7na2/lib -liconv -lm -ldl
#10 1.276 	XMLCPPFlag = 

Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
@plexoos plexoos added the infrastructure Build environment and configuration label Feb 26, 2023
@plexoos plexoos merged commit 419bce1 into star-bnl:main Mar 11, 2023
@plexoos plexoos deleted the pr/fix_cons_libxml_inc branch March 11, 2023 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Build environment and configuration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants