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

Extend system package scripts to handle macports; tox.ini: Add macports environment #31505

Closed
mkoeppe opened this issue Mar 17, 2021 · 199 comments · Fixed by #35667
Closed

Extend system package scripts to handle macports; tox.ini: Add macports environment #31505

mkoeppe opened this issue Mar 17, 2021 · 199 comments · Fixed by #35667

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 17, 2021

Based on #30504, which added MacPorts package information, we update the system package scripts to include support for MacPorts.

Current Sage builds just fine on a system with MacPorts.
To test this, we add local-macports environments to tox.ini:

tox -e local-macports-minimal

or

tox -e local-macports-standard             # uses /usr/bin/python3

or

tox -e local-macports-standard-python3.10  # uses python3.10 from macports

Each of these commands creates an isolated installation of MacPorts in a subdirectory of .tox (using https://guide.macports.org/#installing.macports.source.multiple
); it will not use or modify /opt/local.

(There is also tox -e local-macports-optlocal-standard, which uses sudo to install things into the default location -- use at your own risk.)

Requested at

Upstream: Not yet reported upstream; Will do shortly.

CC: @slel @kliem @jhpalmieri @dimpase @seblabbe @vbraun @zlscherr

Component: porting

Author: Matthias Koeppe

Branch/Commit: u/mkoeppe/tox_ini__add_macports_environment @ 476fa33

Issue created by migration from https://trac.sagemath.org/ticket/31505

@mkoeppe mkoeppe added this to the sage-9.3 milestone Mar 17, 2021
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 17, 2021

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 17, 2021

Author: Matthias Koeppe

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 17, 2021

Commit: 72c9241

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 17, 2021

New commits:

ab5819btox.ini: Add local-macports
8131271Add macports.txt
45dec6abuild/pkgs/_prereq/distros: Update file comments
8e1393cbuild/bin/sage-print-system-package-command: Handle macports install
72c9241m4/sage_check_osx_supported.m4: Do not exit with error if fink or macports is found

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 17, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

b6f1596tox.ini (local-macports-optlocal): Use sudo

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 17, 2021

Changed commit from 72c9241 to b6f1596

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 18, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

e9eeb0bbuild/bin/sage-print-system-package-command (macports): Handle setup-build-env
2189890build/bin/sage-guess-package-system: Detect macports

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 18, 2021

Changed commit from b6f1596 to 2189890

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 18, 2021

Dependencies: #30504

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 18, 2021

Changed commit from 2189890 to 4acfc5c

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 18, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

4f7398eUpdate repology info
338674930504: Rename and remove distros files from #29129 and #30619
7c272ecAdd MacPorts package info
8c9f53c30504: Add _recommended package info for MacPorts
bf0a4d230504: Use zmq-devel in MacPorts for zeromq
e42448930504: Fix gcc gfortran openblas info for MacPorts
b8b7092build/pkgs/{gcc,gfortran}/distros/macports.txt: Fixup
4acfc5cMerge #30504

@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe changed the title tox.ini: Add macports environment Extend system package scripts to handle macports; tox.ini: Add macports environment Mar 18, 2021
@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe changed the title Extend system package scripts to handle macports; tox.ini: Add macports environment Remove outdated macports ban; Extend system package scripts to handle macports; tox.ini: Add macports environment Mar 18, 2021
@slel
Copy link
Member

slel commented Mar 21, 2021

comment:13

No need for a .macports-build-env file similar to .homebrew-build-env?

@slel

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 21, 2021

comment:15

I don't think we need this - only 1 command is needed to prepare the build

@slel
Copy link
Member

slel commented Mar 21, 2021

comment:16

The tox -e ... commands run ./bootstrap && ./configure && make or similar.

Could they run ./bootstrap -q && ./configure -q && make -s V=0 instead?

@slel
Copy link
Member

slel commented Mar 21, 2021

comment:17

Oh in fact they already do. Sorry for the noise. I'm trying this out and will report.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 21, 2021

comment:18

Yes, make runs with V=0, but for the others I really want to see the output.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 21, 2021

comment:19

For more quiet, you can use tox -p auto -e local-macports-standard -- config.status (logs will appear in .tox/local-macports-standard/log

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 29, 2022

comment:163

The actual g++ error message is missing in what you pasted here

@dimpase
Copy link
Member

dimpase commented Aug 29, 2022

comment:164

right - I thought it's some kind of Python packaging error :-)

    INFO: compile options: '-I///Users/dima/software/sage/.tox/local-macports-standard/macports/include -
Isage/cpython -Isage/libs/ntl -Isage/libs/arb -I/Users/dima/software/sage/.tox/local-macports-standard/lo
cal/lib/python3.8/site-packages/cypari2 -Isage/libs/flint -I/Users/dima/software/sage/.tox/local-macports
-standard/local/lib/python3.8/site-packages/cysignals -I/Users/dima/software/sage/src -I/Users/dima/softw
are/sage/.tox/local-macports-standard/local/lib/python3.8/site-packages/numpy/core/include -I/Application
s/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -I/Use
rs/dima/software/sage/.tox/local-macports-standard/local/include -I/Applications/Xcode.app/Contents/Devel
oper/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c'
    extra options: '-std=c++11'
    INFO: gcc: sage/rings/number_field/number_field_element_quadratic.cpp
    In file included from sage/rings/number_field/number_field_element_quadratic.cpp:837:
    In file included from sage/libs/flint/flint_wrap.h:42:
    ///Users/dima/software/sage/.tox/local-macports-standard/macports/include/flint/fmpz_mod_poly.h:306:12: error: use of undeclared identifier '_fmpz_poly_deflation'; did you mean 'fmpz_mod_poly_deflation'?
        return _fmpz_poly_deflation(input->coeffs, input->length);
               ^~~~~~~~~~~~~~~~~~~~
               fmpz_mod_poly_deflation
    ///Users/dima/software/sage/.tox/local-macports-standard/macports/include/flint/fmpz_mod_poly.h:303:7: note: 'fmpz_mod_poly_deflation' declared here
    ulong fmpz_mod_poly_deflation(const fmpz_mod_poly_t input,
          ^
    ///Users/dima/software/sage/.tox/local-macports-standard/macports/include/flint/fmpz_mod_poly.h:306:33: error: cannot initialize a parameter of type 'const fmpz_mod_poly_struct *' with an lvalue of type 'fmpz *const' (aka 'long *const')
        return _fmpz_poly_deflation(input->coeffs, input->length);
...

macports comes with flint 2.9.0, so it seems there is some kind of incompatibility with our 2.8.4.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 29, 2022

comment:165

The problem is that -I///Users/dima/software/sage/.tox/local-macports-standard/macports/include at the front of the command line. It's not supposed to be there

@dimpase
Copy link
Member

dimpase commented Aug 29, 2022

comment:166

Replying to @mkoeppe:

The problem is that -I///Users/dima/software/sage/.tox/local-macports-standard/macports/include at the front of the command line. It's not supposed to be there

that's probably what tox is doing to create an isolated environment, no?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 29, 2022

comment:167

No, this is the install location of macports within the tox environment. I set these variables:

+    local-macports:           MP_PREFIX={envdir}/macports
+    local-macports:   PATH={env:MP_PREFIX}/bin:/usr/bin:/bin:/usr/sbin:/sbin
+    local-macports:   CPATH={env:MP_PREFIX}/include
+    local-macports:   LIBRARY_PATH={env:MP_PREFIX}/lib
+    local-macports:   SETENV=eval $(build/bin/sage-print-system-package-command {env:SYSTEM} setup-build-env)

but not CFLAGS.

@dimpase
Copy link
Member

dimpase commented Aug 29, 2022

comment:168

Then it's done by macports, not by tox.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 29, 2022

comment:169

Could you check what the macports-installed python3 gives when you ask it python3 -m sysconfig

@dimpase
Copy link
Member

dimpase commented Aug 30, 2022

comment:170

there are 2 installations of python3.10 in .tox/local-macports-standard/:

dima@oucl13243 sage %  .tox/local-macports-standard/macports/bin/python3.10
Python 3.10.6 (main, Aug 27 2022, 17:58:26) [Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 
dima@oucl13243 sage %  .tox/local-macports-standard/bin/python3
Python 3.10.6 (main, Aug 11 2022, 13:49:25) [Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

The latter is the only python3 (without .10), though.

@dimpase
Copy link
Member

dimpase commented Aug 30, 2022

Attachment: p1.gz

sysconfig1

@dimpase
Copy link
Member

dimpase commented Aug 30, 2022

Attachment: p2.gz

sysconf2

@dimpase
Copy link
Member

dimpase commented Aug 30, 2022

comment:171

attached are their outputs when run with -m sysconfig.

(there is also python2.7.18 - hopefully we have stopped all python2's used in our build by now...)

@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Sep 19, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.8, sage-9.9 Jan 7, 2023
@mkoeppe mkoeppe removed this from the sage-10.0 milestone Apr 30, 2023
vbraun pushed a commit to vbraun/sage that referenced this issue Dec 21, 2023
    
this is the branch from sagemath#31505, rebased over Sage 10.0 branch

Resolves sagemath#31505

- Depends on sagemath#36910 (merged here)
    
URL: sagemath#35667
Reported by: Dima Pasechnik
Reviewer(s):
vbraun pushed a commit to vbraun/sage that referenced this issue Dec 22, 2023
    
this is the branch from sagemath#31505, rebased over Sage 10.0 branch

Resolves sagemath#31505

- Depends on sagemath#36910 (merged here)
    
URL: sagemath#35667
Reported by: Dima Pasechnik
Reviewer(s):
vbraun pushed a commit to vbraun/sage that referenced this issue Dec 23, 2023
    
this is the branch from sagemath#31505, rebased over Sage 10.0 branch

Resolves sagemath#31505

- Depends on sagemath#36910 (merged here)
    
URL: sagemath#35667
Reported by: Dima Pasechnik
Reviewer(s):
vbraun pushed a commit to vbraun/sage that referenced this issue Dec 24, 2023
    
this is the branch from sagemath#31505, rebased over Sage 10.0 branch

Resolves sagemath#31505

- Depends on sagemath#36910 (merged here)
    
URL: sagemath#35667
Reported by: Dima Pasechnik
Reviewer(s):
vbraun pushed a commit to vbraun/sage that referenced this issue Dec 25, 2023
this is the branch from sagemath#31505, rebased over Sage 10.0 branch

Resolves sagemath#31505

- Depends on sagemath#36910 (merged here)

URL: sagemath#35667
Reported by: Dima Pasechnik
Reviewer(s):
@vbraun vbraun closed this as completed in c0372d9 Dec 26, 2023
@mkoeppe mkoeppe added this to the sage-10.3 milestone Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants