Open icmccorm opened 1 year ago
Hi @icmccorm, I could reproduce your issue. Seems that our installation process is somewhat broken. However, with the non-bootstrap build I could still get myphasartool to build successfully (when out-commenting the stuff about WholeProgramAnalysis which seems to be out-of-sync with rest of phasar). I will see, what we can do about this issue.
Can you please check whether #532 fixes the warnings you get from cmake?
Sure! I'll be able to look at this in the next day or so, and I'll get back to you ASAP.
My apologies for the delay!
I tried building this in the first docker container configuration I mentioned, which I had linked under Dockerfile-custom.txt. I received the following error:
CMake Error at CMakeLists.txt:139 (find_package):
Could not find a configuration file for package "LLVM" that is compatible
with requested version "10".
The following configuration files were considered but not accepted:
/usr/lib/llvm-14/cmake/LLVMConfig.cmake, version: 14.0.6
/lib/llvm-14/cmake/LLVMConfig.cmake, version: 14.0.6
I haven't been able to try this again with Dockerfile-bootstrap.txt, but I'll follow up again in the next day or two once I can!
what is the state of this issue? @icmccorm ?
Sorry for the wait! I just tried building in a local docker container using ./bootstrap.sh on my M1 Mac, and it worked correctly, passing all tests. Closing this issue.
Looks like the example is again broken on develop branch, with the renaming and split of libraries.
I have tried to add the libraries by changing here to
set(PHASAR_COMPONENTS
utils
config
llvm_utils
passes
llvm_db
db
llvm_pointer
pointer
llvm_controlflow
controlflow
llvm_typehierarchy
taintconfig
llvm_ifdside
)
, but now I get this error
CMake Error at CMakeLists.txt:16 (find_package):
Found package configuration file:
/usr/local/phasar/lib/cmake/phasar/phasarConfig.cmake
but it set phasar_FOUND to FALSE so package "phasar" is considered to be
NOT FOUND. Reason given by package:
The following imported targets are referenced, but are missing:
phasar::phasar_llvm
Add llvm
to it introduces more errors, looks like there's dependency issue in these
hi @asesidaa, thanks for pointing that out. You are right, the installation is broken again. Can you try whether https://github.com/secure-software-engineering/phasar/tree/f-FixInstallAfterReworkFolderStructure fixes the issue?
Thanks for the quick fix. I have tested it, the example now works correctly.
Oh, and another issue related to nlohmann_json_schema_validator
also occured at my end, but I was able to fix that issue.
It seems that when installed using bootstrap.sh
the cmake files for nlohmann_json_schema_validator
library are installed into /usr/local/lib/cmake
instead of /usr/local/phasar/lib/cmake
, and _IMPORT_PREFIX
is set to /usr/local
where as the real library (.so) files are installed into /usr/local/phasar/lib
. By manually moving the files to correct location and fix the prefix, this issue was solved manually.
Thanks for that observation. For this one I don't have a quick fix^^. We will see what we can do about it
It seems that the json validator repo has updated the cmake file about install, which could be related?
https://github.com/pboettch/json-schema-validator/blob/main/CMakeLists.txt#L129 https://github.com/pboettch/json-schema-validator/blob/27fc1d094503623dfe39365ba82581507524545c/CMakeLists.txt#L158
Bug description
I receive warnings of the following form when executing
cmake .
as a step toward building the use-phasar-as-library example.This occurs for both
phasar::phasar_phasarllvm_utils
andphasar::phasar_utils
. When usingbootstrap.sh
as opposed to a custom build script, I also encountered this error:I have been able to build and use PhaSAR's example-tool without these errors occurring; this only happens when building something outside of PhaSAR's source.
Configuration
This occurs when building PhaSAR's use-phasar-as-library example in a Docker container on my M1 MacBook Pro; x86 emulation isn't enabled. I have created a directory with the contents of
use-phasar-as-library
and a clone of PhaSAR inside. The structure is like so:When troubleshooting, I built PhaSAR in two ways. In the first configuration, I executed
sudo ./bootstrap.sh
as suggested in the readme. Only this configuration triggered the error withjson_schema_validator
. In the second configuration, I recreated the commands used in the GitHub Actions workflow configuration with an additionalcmake . --install
at the end. Both Dockerfiles are attached below to assist with recreating these errors.Within
CMakeLists.txt
, I set thePHASAR_LIBRARY_DIR
andPHASAR_INCLUDE_DIR
variables to point to theinclude
andlib
directories in bothphasar/build/
as well as/usr/local/lib/phasar/
and/usr/local/include/phasar/
. The error occurred with each of these options.Steps to reproduce
bootstrap.sh
or the commands for a Release build as specified in ci.ymlPHASAR_LIB_DIR
andPHASAR_INCLUDE_DIR
environment variables to point to thelib
andinclude
directories in either/usr/local/../phasar
or in thebuild
directory of the clone of PhaSAR.cmake .
in the directory containing the contents of use-phasar-as-libraryContext (Environment)
Operating System:
Build Type:
Possible solution
Unknown.
Example files
Here are Dockerfiles that recreate each of the configurations I used.
Files:
Many thanks for your time and assistance!