Closed haruki3hhh closed 6 months ago
Please remove the command entry mistake above and focus on the error.
Was srcML installed from the develop branch? Do that, or request an installer.
Also, it appears above that the cmake is being run to build in the source directory. In cmake, prefer out-of-source builds, not in-source builds.
Thank you for comments!
I checkout to origin/develop
and recompile the srcML with cmake 3.28 as following:
cmake .
make -j
and recompile the nameCollector
by:
cmake . -DsrcML_DIR=~/srcML/
The error msg goes to:
root@b9aa49420b57:~/nameCollector# cmake . -DsrcML_DIR=~/srcML/
CMake Error at CMakeLists.txt:44 (find_package):
Found package configuration file:
/root/srcML/srcMLConfig.cmake
but it set srcML_FOUND to FALSE so package "srcML" is considered to be NOT
FOUND. Reason given by package:
LibsrcML `shared` libraries were requested but not found.
I checked the srcML/bin/
as following files there:
libsrcml.a libsrcml.so libsrcml.so.1 libsrcml.so.1.0.0 srcml
Don't build in the source directory. Build in a build directory.
Install using srcml from the develop branch. Do not set an environment variable, just install.
Again, for srcML, do not build in the source directory
Thank you for reminding me!
I changed my compiling way to:
cd srcML/
mkdir build
cmake ./CMakeLists.txt -B build
make -j`nproc` -C build/
And another error comes out as following:
[ 63%] Linking CXX shared library ../../bin/libsrcml.so
/usr/bin/ld: CMakeFiles/libsrcml.dir/qli_extensions.cpp.o: relocation R_X86_64_TPOFF32 against `__tls_guard' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
make[2]: *** [src/libsrcml/CMakeFiles/libsrcml_shared.dir/build.make:199: bin/libsrcml.so.1.0.0] Error 1
make[1]: *** [CMakeFiles/Makefile2:424: src/libsrcml/CMakeFiles/libsrcml_shared.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
should I add a -fPIC
flags to continue the compiling process?
Not sure if it will affect the nameCollector
Use the cmake presets. —preset macos-release
or —preset ubuntu-release
On Mar 2, 2024, at 12:07 PM, haruki3hhh @.***> wrote:
CAUTION: This email originated from outside of The University of Akron. Use caution when opening attachments, clicking links or responding to requests for information.
Thank you for reminding me!
I changed my compiling way to:
cd srcML/
mkdir build
cmake ./CMakeLists.txt -B build
make -jnproc
-C build/
And another error comes out as following:
[ 63%] Linking CXX shared library ../../bin/libsrcml.so /usr/bin/ld: CMakeFiles/libsrcml.dir/qli_extensions.cpp.o: relocation R_X86_64_TPOFF32 against `__tls_guard' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: failed to set dynamic section sizes: bad value collect2: error: ld returned 1 exit status make[2]: [src/libsrcml/CMakeFiles/libsrcml_shared.dir/build.make:199: bin/libsrcml.so.1.0.0] Error 1 make[1]: [CMakeFiles/Makefile2:424: src/libsrcml/CMakeFiles/libsrcml_shared.dir/all] Error 2 make: *** [Makefile:166: all] Error 2
should I add a -fPIC flags to continue the compiling process?
Not sure if it will affect the nameCollector
— Reply to this email directly, view it on GitHubhttps://github.com/srcML/nameCollector/issues/1#issuecomment-1974853746, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABGLMV5YM2TD72Y2SUUAFBLYWIBOZAVCNFSM6AAAAABECQ6XVKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZUHA2TGNZUGY. You are receiving this because you commented.Message ID: @.***>
Thank you for suggestion!
I do the following things:
cd ~/srcML/build
cmake .. --preset ubuntu-release
ninja
ninja install
and set the srcML_DIR path in nameCollector:
cd ~/nameCollector/build
cmake .. -DsrcML_DIR=~/srcML/build/
it seems still have some issues as following:
CMake Error at CMakeLists.txt:44 (find_package):
Found package configuration file:
/root/srcML/build/srcMLConfig.cmake
but it set srcML_FOUND to FALSE so package "srcML" is considered to be NOT
FOUND. Reason given by package:
LibsrcML `shared` libraries were requested but not found.
Quit setting the path. Do not set the path. Forget about srcML_DIR
Where is the result of the install?
On Mar 2, 2024, at 12:48 PM, haruki3hhh @.***> wrote:
CAUTION: This email originated from outside of The University of Akron. Use caution when opening attachments, clicking links or responding to requests for information.
Thank you for suggestion!
I do the following things:
cd ~/srcML/build cmake .. --preset ubuntu-release ninja ninja install
and set the srcML_DIR path in nameCollector:
cd ~/nameCollector/build cmake .. -DsrcML_DIR=~/srcML/build/
it seems still have some issues as following:
CMake Error at CMakeLists.txt:44 (find_package): Found package configuration file:
/root/srcML/build/srcMLConfig.cmake
but it set srcML_FOUND to FALSE so package "srcML" is considered to be NOT FOUND. Reason given by package:
LibsrcML shared
libraries were requested but not found.
— Reply to this email directly, view it on GitHubhttps://github.com/srcML/nameCollector/issues/1#issuecomment-1974863173, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABGLMV2KVOUDCCRDGVHRMO3YWIGGZAVCNFSM6AAAAABECQ6XVKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZUHA3DGMJXGM. You are receiving this because you commented.Message ID: @.***>
Hi mlcollard,
I successfully compiled the nameCollector
by not setting the srcML path!
Thank you very much for your patience : )
My Final build script:
git clone https://github.com/srcML/srcSAX.git
git clone https://github.com/srcML/srcML.git
git clone https://github.com/srcML/nameCollector.git
# first build srcML
pushd srcML
git reset --hard origin/develop
mkdir build
cmake . --preset ubuntu-release -B build/
ninja -C build/
ninja -C build/ install
popd
pushd srcSAX
mkdir build
cmake . -B build/
make -j`nproc` -C build/
make -C build/ install
popd
pushd nameCollector
mkdir build
cmake . -B build/
make -j`nproc` -C build/
file build/bin/nameCollector
popd
I have compiled the srcML in
/root/srcML
, and want to compile nameCollector in/root/nameCollector
but output errors as following: