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

Fails on macOS ARM64 #12

Open
paxter opened this issue Jan 14, 2024 · 12 comments
Open

Fails on macOS ARM64 #12

paxter opened this issue Jan 14, 2024 · 12 comments

Comments

@paxter
Copy link

paxter commented Jan 14, 2024

brew install nasa-sw-vnv/core/ikos
[...]
==> make install
Last 15 lines from /Users/user/Library/Logs/Homebrew/ikos/04.make:
[ 13%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/bundle.cpp.o
[ 14%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/code.cpp.o
[ 14%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/context.cpp.o
[ 14%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/context_impl.cpp.o
[ 16%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/data_layout.cpp.o
[ 16%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/function.cpp.o
[ 18%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/intrinsic.cpp.o
[ 18%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/statement.cpp.o
[ 19%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/type.cpp.o
[ 19%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/value.cpp.o
[ 21%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/verify/frontend.cpp.o
[ 21%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/verify/type.cpp.o
[ 22%] Linking CXX static library libikos-ar.a
[ 22%] Built target ikos-ar
make: *** [all] Error 2

Full log file attached. Let me know if you need anything further. :)
04.make.zip

@ivanperez-keera
Copy link
Collaborator

@paxter Could you please try the latest version? Thanks!

@paxter
Copy link
Author

paxter commented Oct 1, 2024

Still not working.

==> make install
Last 15 lines from /Users/empire/Library/Logs/Homebrew/ikos/04.make:
[ 11%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/bundle.cpp.o
[ 11%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/context.cpp.o
[ 11%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/context_impl.cpp.o
[ 13%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/code.cpp.o
[ 14%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/data_layout.cpp.o
[ 14%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/function.cpp.o
[ 16%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/intrinsic.cpp.o
[ 16%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/statement.cpp.o
[ 18%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/type.cpp.o
[ 18%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/value.cpp.o
[ 19%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/verify/frontend.cpp.o
[ 19%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/verify/type.cpp.o
[ 21%] Linking CXX static library libikos-ar.a
[ 21%] Built target ikos-ar
make: *** [all] Error 2

@nadiasvertex
Copy link

nadiasvertex commented Nov 15, 2024

I am experiencing the same problem:

brew install nasa-sw-vnv/core/ikos
==> Auto-updating Homebrew...
Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with
HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Fetching nasa-sw-vnv/core/ikos
==> Downloading https://files.pythonhosted.org/packages/7e/ae/26808275fc76bf2832deb10d3a3ed3107bc4de01b85dcccbe525f2cd6d1e/Pygments-2.4.2.tar.gz
Already downloaded: /Users/csnelson/Library/Caches/Homebrew/downloads/6ca94f739e0ce8b61064d8fa84dcd6adf34e71e1a606f1ec9403a187965de88c--Pygments-2.4.2.tar.gz
==> Downloading https://github.com/NASA-SW-VnV/ikos/archive/refs/tags/v3.4.tar.gz
Already downloaded: /Users/csnelson/Library/Caches/Homebrew/downloads/c1ac6a3a7673251b28ad826e61187ec64a562d110633a344ae2068bc960755ef--ikos-3.4.tar.gz
==> Installing ikos from nasa-sw-vnv/core
==> python3 -m venv --system-site-packages --without-pip /opt/homebrew/Cellar/ikos/3.4_1/libexec
==> python3 -m pip --python=/opt/homebrew/Cellar/ikos/3.4_1/libexec/bin/python install /private/tmp/ikos--Pygments-20241115-74116-u1sr12/Pygments-2.4.2
==> cmake -G Unix Makefiles -DGMP_ROOT=/opt/homebrew/opt/gmp -DMPFR_ROOT=/opt/homebrew/opt/mpfr -DPPL_ROOT=/opt/homebrew/opt/ppl -DAPRON_ROOT=/opt/homebrew/opt/apron -DCUSTOM_BOOST_ROOT=/opt/homebrew/opt/boost -DPYTHON_EXECUTABLE=/opt/homebrew/Cellar/ikos/3.4_1/libexec/bin/python -D
==> make install
Last 15 lines from /Users/csnelson/Library/Logs/Homebrew/ikos/04.make:
make[1]: *** Waiting for unfinished jobs....
[ 14%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/code.cpp.o
[ 14%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/context.cpp.o
[ 14%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/context_impl.cpp.o
[ 16%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/data_layout.cpp.o
[ 16%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/function.cpp.o
[ 18%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/intrinsic.cpp.o
[ 18%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/statement.cpp.o
[ 19%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/type.cpp.o
[ 19%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/value.cpp.o
[ 21%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/verify/frontend.cpp.o
[ 21%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/verify/type.cpp.o
[ 22%] Linking CXX static library libikos-ar.a
[ 22%] Built target ikos-ar
make: *** [all] Error 2

Full build log is attached.

04.make.gz

@Leonezz
Copy link

Leonezz commented Nov 22, 2024

Same error, kind curious anyone successfull intalled yet, since I failed on CentOS 7, Ubuntu 20.02 and mac os arm64.

@rudifa
Copy link

rudifa commented Dec 17, 2024

I have the same problem on macOS Sequoia 15.2, please help:

newcpp % brew install nasa-sw-vnv/core/ikos
==> Auto-updating Homebrew...
Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with
HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Fetching nasa-sw-vnv/core/ikos
==> Downloading https://files.pythonhosted.org/packages/7e/ae/26808275fc76bf2832deb10d3a3ed3107bc4de01b85dcccbe525f2cd6d
Already downloaded: /Users/rudifarkas/Library/Caches/Homebrew/downloads/6ca94f739e0ce8b61064d8fa84dcd6adf34e71e1a606f1ec9403a187965de88c--Pygments-2.4.2.tar.gz
==> Downloading https://github.com/NASA-SW-VnV/ikos/archive/refs/tags/v3.4.tar.gz
Already downloaded: /Users/rudifarkas/Library/Caches/Homebrew/downloads/c1ac6a3a7673251b28ad826e61187ec64a562d110633a344ae2068bc960755ef--ikos-3.4.tar.gz
==> Installing ikos from nasa-sw-vnv/core
==> python3 -m venv --system-site-packages --without-pip /opt/homebrew/Cellar/ikos/3.4_1/libexec
==> python3 -m pip --python=/opt/homebrew/Cellar/ikos/3.4_1/libexec/bin/python install /private/tmp/ikos--Pygments-20241
==> cmake -G Unix Makefiles -DGMP_ROOT=/opt/homebrew/opt/gmp -DMPFR_ROOT=/opt/homebrew/opt/mpfr -DPPL_ROOT=/opt/homebrew
==> make install
Last 15 lines from /Users/rudifarkas/Library/Logs/Homebrew/ikos/04.make:
make[1]: *** [frontend/llvm/CMakeFiles/ikos-pp-lib.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 16%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/context.cpp.o
[ 16%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/context_impl.cpp.o
[ 18%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/data_layout.cpp.o
[ 18%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/function.cpp.o
[ 19%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/intrinsic.cpp.o
[ 19%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/statement.cpp.o
[ 21%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/type.cpp.o
[ 21%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/semantic/value.cpp.o
[ 21%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/verify/frontend.cpp.o
[ 22%] Building CXX object ar/CMakeFiles/ikos-ar.dir/src/verify/type.cpp.o
[ 22%] Linking CXX static library libikos-ar.a
[ 22%] Built target ikos-ar
make: *** [all] Error 2

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/nasa-sw-vnv/homebrew-core/issues

These open issues may also help:
Getting error while installing IKOS https://github.com/NASA-SW-VnV/homebrew-core/issues/19

My system data:

newcpp % sw_vers
ProductName:		macOS
ProductVersion:		15.2
BuildVersion:		24C101

newcpp % xcode-select --version
xcode-select version 2409.
newcpp % xcodebuild -version
Xcode 16.2
Build version 16C5032a
newcpp % pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version
2:version: 16.2.0.0.1.1733547573

@ivanperez-keera
Copy link
Collaborator

ivanperez-keera commented Dec 17, 2024

To be clear, the issue persists with the latest version on ikos' repo (https://github.com/NASA-SW-VnV/ikos), not this homebrew repo, right?

I ask because there was a recent issue fixed in ikos that addressed similar "symptoms". That version will be released soon but the homebrew package currently installs the version released in September.

@rudifa
Copy link

rudifa commented Dec 18, 2024

@ivanperez-keera I don't quite understand your first phrase above.

As you can see in my terminal trace, I ran

brew install nasa-sw-vnv/core/ikos
which downloaded v3.4

==> Downloading https://github.com/NASA-SW-VnV/ikos/archive/refs/tags/v3.4.tar.gz

which corresponds to the latest release seen on your repo:

Public release 3.4 Latest
@ivanperez-keera ivanperez-keera released this Oct 1

Presumably your 2 commits since Oct 1 fix my problem, however I did not test that.

When do you expect to release the new version?

Or, should I clone the ikon project and build it myself?

@ivanperez-keera
Copy link
Collaborator

IKOS is released every 3 months, so I expect to release in 2 weeks.

I'd like to make sure this bug is fixed for the upcoming release.

It'll help if you can build it from source, or adjust the formula to point to use the current master, to see if the error was fixed also for Mac.

@rudifa
Copy link

rudifa commented Dec 19, 2024

@ivanperez-keera On my MacBookPro M3 Sequoia, I cloned the ikos repo and built it from the source.

Here is the terminal log:
ikos-make-install-log.txt

It looks OK to me, bar warnings; there are 4 failures in the make check.

I tried to run ikos on the main.cpp given as an example in the README.md.

First it did not find the libboost_filesystem.dyliband I fixed it with export DYLD_LIBRARY_PATH="/opt/homebrew/lib:$DYLD_LIBRARY_PATH".

Next, it failed wit a dyld[36337]: Symbol not found (see the next log): would this be about different versions of the boost library?
ikos-sample-ikos-log.txt

At this point I stopped, and I hope that you can advise on the next steps.

===

Also, on my Ubuntu-on-macbookpro, I ran brew install nasa-sw-vnv/core/ikos which finished successfully, but it has a problem:

$ ikos --version
error: could not find ikos python module
error: see TROUBLESHOOTING.md

I added locally in the terminal

export PYTHONPATH=/home/linuxbrew/.linuxbrew/Cellar/ikos/3.4_1/libexec/lib/python3.13/site-packages/
but this did not fix the problem.

Do you have any advice here? Should I post a separate issue?

UPDATE: SOLVED, SEE MY NEXT COMMENT

@rudifa
Copy link

rudifa commented Dec 19, 2024

I just noticed the issue#306 which reports the same brew install problem as the mine, but on an Intel Sequoia Mac.

@rudifa
Copy link

rudifa commented Dec 19, 2024

UPDATE RE Ubuntu-on-macbookpro: I FIXED THE ikos 3.4_1 INSTALLED WITH brew install ikos

  1. I applied the fix by @tarikgta2 to the local copy of analyzer.py

  2. I added to my .bashrc

export PYTHONPATH=/home/linuxbrew/.linuxbrew/Cellar/ikos/3.4_1/libexec/lib/python3.13/site-packages/

Now the demo ikos loop.c from your README.md works as advertised:

rudifarkas:hello$ ikos loop.c
[*] Compiling loop.c
[*] Running ikos preprocessor
[*] Running ikos analyzer
[*] Translating LLVM bitcode to AR
[*] Running liveness analysis
[*] Running widening hint analysis
[*] Running interprocedural value analysis
[*] Analyzing entry point 'main'
[*] Checking properties for entry point 'main'

# Time stats:
clang        : 0.095 sec
ikos-analyzer: 0.020 sec
ikos-pp      : 0.009 sec

# Summary:
Total number of checks                : 16
Total number of unreachable checks    : 0
Total number of safe checks           : 14
Total number of definite unsafe checks: 2
Total number of warnings              : 0

The program is definitely UNSAFE

# Results
loop.c: In function 'main':
loop.c:8:11: error: buffer overflow, accessing index 10 of global variable 'a' of 10 elements
     a[i] = i;
          ^
loop.c: In function 'main':
loop.c:9:19: error: buffer overflow, accessing index 10 of global variable 'a' of 10 elements
     printf("%i", a[i]);
                  ^

@ivanperez-keera
Copy link
Collaborator

ivanperez-keera commented Dec 31, 2024

For those experiencing the installation issue where installation stops in the middle, please see NASA-SW-VnV/ikos#306 (comment). I'm working on a fix but using that formula may help.

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

No branches or pull requests

5 participants