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

Failing to install solvers on Apple M1 chip #751

Open
ninell-oldenburg opened this issue Mar 14, 2023 · 4 comments
Open

Failing to install solvers on Apple M1 chip #751

ninell-oldenburg opened this issue Mar 14, 2023 · 4 comments

Comments

@ninell-oldenburg
Copy link

ninell-oldenburg commented Mar 14, 2023

Hi,

I was trying to install different solvers on an Apple M1 chip but they apparently keep failing.

E.g., this is the error message for picoSAT:

gcc -fPIC -o picosat main.o app.o -L. -lpicosat
ld: warning: ignoring file ./libpicosat.a, building for macOS-arm64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture arm64:
  "_picosat_add", referenced from:
      _parse in app.o
      _blocksol in app.o
  "_picosat_added_original_clauses", referenced from:
      _picosat_main in app.o
  "_picosat_adjust", referenced from:
      _parse in app.o
  "_picosat_assume", referenced from:
      _picosat_main in app.o
  "_picosat_config", referenced from:
      _picosat_main in app.o
  "_picosat_copyright", referenced from:
      _picosat_main in app.o
  "_picosat_corelit", referenced from:
      _write_core_variables in app.o
  "_picosat_deref", referenced from:
      _printa in app.o
      _blocksol in app.o
  "_picosat_deref_partial", referenced from:
      _printa in app.o
  "_picosat_enable_trace_generation", referenced from:
      _picosat_main in app.o
  "_picosat_enter", referenced from:
      _picosat_main in app.o
  "_picosat_failed_assumption", referenced from:
      _write_failed_assumptions in app.o
  "_picosat_init", referenced from:
      _picosat_main in app.o
  "_picosat_leave", referenced from:
      _picosat_main in app.o
  "_picosat_message", referenced from:
      _message in app.o
      _interrupt_call_back in app.o
  "_picosat_print", referenced from:
      _picosat_main in app.o
  "_picosat_reset", referenced from:
      _picosat_main in app.o
  "_picosat_sat", referenced from:
      _picosat_main in app.o
  "_picosat_save_original_clauses", referenced from:
      _picosat_main in app.o
  "_picosat_set_global_default_phase", referenced from:
      _picosat_main in app.o
  "_picosat_set_incremental_rup_file", referenced from:
      _parse in app.o
  "_picosat_set_interrupt", referenced from:
      _setalarm in app.o
  "_picosat_set_output", referenced from:
      _picosat_main in app.o
  "_picosat_set_plain", referenced from:
      _picosat_main in app.o
  "_picosat_set_propagation_limit", referenced from:
      _picosat_main in app.o
  "_picosat_set_seed", referenced from:
      _picosat_main in app.o
  "_picosat_set_verbosity", referenced from:
      _picosat_main in app.o
  "_picosat_stats", referenced from:
      _picosat_main in app.o
      _catch in app.o
  "_picosat_time_stamp", referenced from:
      _picosat_main in app.o
  "_picosat_variables", referenced from:
      _picosat_main in app.o
      _write_core_variables in app.o
      _write_failed_assumptions in app.o
      _printa in app.o
      _blocksol in app.o
  "_picosat_version", referenced from:
      _picosat_main in app.o
  "_picosat_write_clausal_core", referenced from:
      _picosat_main in app.o
  "_picosat_write_compact_trace", referenced from:
      _picosat_main in app.o
  "_picosat_write_extended_trace", referenced from:
      _picosat_main in app.o
  "_picosat_write_rup_trace", referenced from:
      _picosat_main in app.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [picosat] Error 1
Traceback (most recent call last):
  File "/Users/nell/miniforge3/bin/pysmt-install", line 8, in <module>
    sys.exit(main())
  File "/Users/nell/miniforge3/lib/python3.10/site-packages/pysmt/cmd/install.py", line 257, in main
    installer.install(force_redo=options.force_redo)
  File "/Users/nell/miniforge3/lib/python3.10/site-packages/pysmt/cmd/installers/base.py", line 147, in install
    self.compile()
  File "/Users/nell/miniforge3/lib/python3.10/site-packages/pysmt/cmd/installers/pico.py", line 57, in compile
    SolverInstaller.run('make', directory=picosat_dir,
  File "/Users/nell/miniforge3/lib/python3.10/site-packages/pysmt/cmd/installers/base.py", line 228, in run
    subprocess.check_call(program, env=environment,
  File "/Users/nell/miniforge3/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['make']' returned non-zero exit status 2.

Other solvers bring other issues, but all seem to be related to the arm-64 architecture. Would it be an option to update those or has maybe anyone found a workaround?

Thanks in advance!

@mikand
Copy link
Contributor

mikand commented Mar 14, 2023

Unfortunately I do not own an Apple Silicon myself.
@cristian-mattarei Have you ever tried installing picosat?

@ninell-oldenburg
Copy link
Author

Update: downloading and building it by hand from your wrappers (e.g. the picosat) does still work :)

@mikand
Copy link
Contributor

mikand commented Mar 14, 2023

Good! Can you post here the commands you used for future reference and also to possibly fix the automated installer? (e.g. you can try to use the history command)

@ninell-oldenburg
Copy link
Author

For PicoSAT:

  1. Download repo from here
  2. Unpack
  3. Rename directory to picosat, e.g. by calling mv pyPicoSAT-master picosat
  4. Move the unpacked, renamed directory to the relevant site-packages directory e.g. by calling something along the lines of mv ~/Downloads/picosat ~/${PATH-TO-SITE-PACKAGES}/site-packages/picosat
  5. Build & Install
python3 setup.py build
python3 setup.py install

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

2 participants