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

Prefer ORtools 7.7 by default #370

Merged
merged 4 commits into from
Mar 10, 2022
Merged

Prefer ORtools 7.7 by default #370

merged 4 commits into from
Mar 10, 2022

Conversation

hyoklee
Copy link
Member

@hyoklee hyoklee commented Mar 9, 2022

No description provided.

@ChristopherHogan
Copy link
Collaborator

From my understanding, our ortools spack package isn't a proper spack package in the sense that its dependencies are not satisfied by other spack packages, but rather are built from scratch as part of the make third_party command here. This command runs this makefile, which checks out sources of all the dependencies and builds them from scratch. Coinutils is included as part of our ortools spack package, but spack isn't aware of it. If you add coinutils as a dependency, spack will build and install coinutils, but so will make third_party, and the spack-installed version will likely be ignored. What prompted you to open this PR?

1 similar comment
@ChristopherHogan
Copy link
Collaborator

From my understanding, our ortools spack package isn't a proper spack package in the sense that its dependencies are not satisfied by other spack packages, but rather are built from scratch as part of the make third_party command here. This command runs this makefile, which checks out sources of all the dependencies and builds them from scratch. Coinutils is included as part of our ortools spack package, but spack isn't aware of it. If you add coinutils as a dependency, spack will build and install coinutils, but so will make third_party, and the spack-installed version will likely be ignored. What prompted you to open this PR?

@hyoklee
Copy link
Member Author

hyoklee commented Mar 9, 2022

@ChristopherHogan , I tried to port Hermes on macOS Monterey via Spack and gortools failed due to coinutils dependency:

 configure: error: Required package CoinUtils not available.
     5781    -> compiling obj/static/O.darwin.x86_64.gnu.opt/lib/scip/scip_probing.o

@ChristopherHogan
Copy link
Collaborator

What command produced this error? I'm confused because our ortools package doesn't seem to have a configure step.

@hyoklee
Copy link
Member Author

hyoklee commented Mar 9, 2022

It occurs when you run without specific version like 7.7: spack install gortools

@ChristopherHogan
Copy link
Collaborator

I see. We have to use version 7.7 of ortools because of #323.

@hyoklee
Copy link
Member Author

hyoklee commented Mar 9, 2022

How about removing : from 7.7: in gortools/package.py?

@ChristopherHogan
Copy link
Collaborator

Doesn't efaa428 just mean "only depend on cmake if we're installing ortools@7.7? If you're suggesting that the package should only allow building version 7.7, then I think we need to remove all the version() calls except for 7.7.

@hyoklee
Copy link
Member Author

hyoklee commented Mar 9, 2022

Spack automatically picks up whatever highest version available when ':' is used and user doesn't specify any version.
Yes, removing all other versions will be good to avoid confusion.

@coveralls
Copy link

coveralls commented Mar 9, 2022

Coverage Status

Coverage decreased (-0.2%) to 81.571% when pulling 40e1436 on hyoklee-patch-9 into aaf4bd3 on master.

@ChristopherHogan
Copy link
Collaborator

I don't think this change has the effect you desire. Have you tested it on macOS? Before this change, spack install gortools would install the highest version in package.yaml, which is 8.0, as well as cmake and its dependencies:

chogan@ubuntu$ spack install --fake gortools
==> Installing pkgconf-1.7.3-thenj5slxuwltrwza2msdtyz2tm4anoh
==> No binary for pkgconf-1.7.3-thenj5slxuwltrwza2msdtyz2tm4anoh found: installing from source
[+] /home/chogan/sw/spack/opt/spack/linux-ubuntu20.04-skylake_avx512/gcc-9.4.0/pkgconf-1.7.3-thenj5slxuwltrwza2msdtyz2tm4anoh
==> Installing berkeley-db-18.1.40-cadguph6xmzuw7e3yuyapjwx5wul4bie
==> No binary for berkeley-db-18.1.40-cadguph6xmzuw7e3yuyapjwx5wul4bie found: installing from source
[+] /home/chogan/sw/spack/opt/spack/linux-ubuntu20.04-skylake_avx512/gcc-9.4.0/berkeley-db-18.1.40-cadguph6xmzuw7e3yuyapjwx5wul4bie
==> Installing zlib-1.2.11-ikd3yzdjgm2i4hc2jxpv4foy6w2ro3rr
==> No binary for zlib-1.2.11-ikd3yzdjgm2i4hc2jxpv4foy6w2ro3rr found: installing from source
[+] /home/chogan/sw/spack/opt/spack/linux-ubuntu20.04-skylake_avx512/gcc-9.4.0/zlib-1.2.11-ikd3yzdjgm2i4hc2jxpv4foy6w2ro3rr
==> Installing ncurses-6.2-bwo4ocl452lxozfzfx44g7w6ehjfld5e
==> No binary for ncurses-6.2-bwo4ocl452lxozfzfx44g7w6ehjfld5e found: installing from source
[+] /home/chogan/sw/spack/opt/spack/linux-ubuntu20.04-skylake_avx512/gcc-9.4.0/ncurses-6.2-bwo4ocl452lxozfzfx44g7w6ehjfld5e
==> Installing readline-8.0-u27u7n5gj4aucvvm5u2puzdeafjpnobb
==> No binary for readline-8.0-u27u7n5gj4aucvvm5u2puzdeafjpnobb found: installing from source
[+] /home/chogan/sw/spack/opt/spack/linux-ubuntu20.04-skylake_avx512/gcc-9.4.0/readline-8.0-u27u7n5gj4aucvvm5u2puzdeafjpnobb
==> Installing gdbm-1.18.1-i4swcgnlj5c7dzywjwuzr3yvbesolhvg
==> No binary for gdbm-1.18.1-i4swcgnlj5c7dzywjwuzr3yvbesolhvg found: installing from source
[+] /home/chogan/sw/spack/opt/spack/linux-ubuntu20.04-skylake_avx512/gcc-9.4.0/gdbm-1.18.1-i4swcgnlj5c7dzywjwuzr3yvbesolhvg
==> Installing perl-5.32.0-q5lzydzalon6r5ijhlqnr7ljgk7vf5kx
==> No binary for perl-5.32.0-q5lzydzalon6r5ijhlqnr7ljgk7vf5kx found: installing from source
[+] /home/chogan/sw/spack/opt/spack/linux-ubuntu20.04-skylake_avx512/gcc-9.4.0/perl-5.32.0-q5lzydzalon6r5ijhlqnr7ljgk7vf5kx
==> Installing openssl-1.1.1h-vxbjpvgejujdbwgdab6orlpfm6qs6rmf
==> No binary for openssl-1.1.1h-vxbjpvgejujdbwgdab6orlpfm6qs6rmf found: installing from source
[+] /home/chogan/sw/spack/opt/spack/linux-ubuntu20.04-skylake_avx512/gcc-9.4.0/openssl-1.1.1h-vxbjpvgejujdbwgdab6orlpfm6qs6rmf
==> Installing cmake-3.19.1-mrztl2b5rxud6iopwjdij3rfeh6latzm
==> No binary for cmake-3.19.1-mrztl2b5rxud6iopwjdij3rfeh6latzm found: installing from source
[+] /home/chogan/sw/spack/opt/spack/linux-ubuntu20.04-skylake_avx512/gcc-9.4.0/cmake-3.19.1-mrztl2b5rxud6iopwjdij3rfeh6latzm
==> Installing gortools-8.0-m7xa65uyg54sahfmhxosy4n7r6vqoypu
==> No binary for gortools-8.0-m7xa65uyg54sahfmhxosy4n7r6vqoypu found: installing from source
[+] /home/chogan/sw/spack/opt/spack/linux-ubuntu20.04-skylake_avx512/gcc-9.4.0/gortools-8.0-m7xa65uyg54sahfmhxosy4n7r6vqoypu

After the change in this PR, spack install gortools still installs version 8.0, but it no longer depends on cmake because 7.7 != 8.0:

chogan@ubuntu-desktop$ spack install --fake gortools
==> Installing gortools-8.0-wji7ycy5qjg4c22paz6wflp6kwuralsq
==> No binary for gortools-8.0-wji7ycy5qjg4c22paz6wflp6kwuralsq found: installing from source
[+] /home/chogan/sw/spack/opt/spack/linux-ubuntu20.04-skylake_avx512/gcc-9.4.0/gortools-8.0-wji7ycy5qjg4c22paz6wflp6kwuralsq

My assumption (and I could be wrong) is that you want spack install gortoolsto install version 7.7 by default. To accomplish that we just need to add preferred=True as a keyword argument to the version(7.7, ...) call.

* Remove duplicate 'self.set_include(env, '{}/include'.format(self.prefix))'.
* Sort by version number.
* Remove template comments.
@ChristopherHogan ChristopherHogan changed the title Add coinutils dependency. Prefer ORtools 7.7 by default Mar 10, 2022
@ChristopherHogan ChristopherHogan merged commit 742a586 into master Mar 10, 2022
@hyoklee hyoklee deleted the hyoklee-patch-9 branch March 29, 2022 14:50
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

Successfully merging this pull request may close these issues.

None yet

3 participants