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

Installation issue: py-matplotlib #11396

Closed
ThrashinVictim opened this issue May 8, 2019 · 49 comments
Closed

Installation issue: py-matplotlib #11396

ThrashinVictim opened this issue May 8, 2019 · 49 comments

Comments

@ThrashinVictim
Copy link

I have Python 3.7.3

When I try spack install py-matplotlib
I get

"py-matplotlib requires python version 3.5:, but spec asked for 2.7.15"

If I try to install using
spack installl py-matplotlib ^python@3.7.3

I get this error.

640 /opt/rh/devtoolset-2/root/usr/libexec/gcc/x86_64-redhat-linux/4.8.2
/ld: /usr/local/lib/libpython3.7m.a(bytesobject.o): relocation R_X8
6_64_32 against `_Py_NoneStruct' can not be used when making a shar
ed object; recompile with -fPIC
641 /usr/local/lib/libpython3.7m.a: could not read symbols: Bad value

642 collect2: error: ld returned 1 exit status
643 error: command '/opt/rh/devtoolset-2/root/usr/bin/gcc' failed with
exit status 1

I am new to spack and any help would be appreciated.

@scheibelp scheibelp self-assigned this May 9, 2019
@scheibelp
Copy link
Member

I'll try to reproduce this tomorrow.

It looks like you're on a RHEL system (RHEL7?) - is that right?

@ThrashinVictim
Copy link
Author

RHel 6.9

Thank you.

@scheibelp
Copy link
Member

I'm having trouble replicating this, but I have only been able to try RHEL 7 so far. A few questions:

  • Do you have any external packages recorded in packages.yaml?
  • Can you show the current output of "spack spec -I py-matplotlib ^python@3:"?
  • Which package build does this fail for (does it succeed with python but fail for matplotlib?)? The messages printed during the install will record which installations succeed (and the process stops at the first failure)

@ThrashinVictim
Copy link
Author

ThrashinVictim commented May 10, 2019

Thanks for the reply

I don't have any external packages recorded in packages.yaml

Input spec
--------------------------------
 -   py-matplotlib
 -       ^python@3:

Concretized
--------------------------------
 -   py-matplotlib@3.0.0%gcc@4.8.2~animation+image~ipython~latex~qt+tk arch=linux-rhel6-x86_64
[+]      ^freetype@2.9.1%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]          ^bzip2@1.0.6%gcc@4.8.2+shared arch=linux-rhel6-x86_64
[+]              ^diffutils@3.6%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]          ^libpng@1.6.34%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]              ^zlib@1.2.11%gcc@4.8.2+optimize+pic+shared arch=linux-rhel6-x86_64
[+]          ^pkgconf@1.4.2%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]      ^py-cycler@0.10.0%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]          ^py-setuptools@40.4.3%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]              ^python@3.7.0%gcc@4.8.2+dbm~optimizations patches=123082ab3483ded78e86d7c809e98a804b3465b4683c96bd79a2fd799f572244 +pic+pythoncmd+shared~tk~ucs4 arch=linux-rhel6-x86_64
[+]                  ^gdbm@1.14.1%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]                      ^readline@7.0%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]                          ^ncurses@6.1%gcc@4.8.2~symlinks~termlib arch=linux-rhel6-x86_64
[+]                  ^libffi@3.2.1%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]                  ^openssl@1.0.2o%gcc@4.8.2+systemcerts arch=linux-rhel6-x86_64
[+]                      ^perl@5.26.2%gcc@4.8.2+cpanm patches=0eac10ed90aeb0459ad8851f88081d439a4e41978e586ec743069e8b059370ac +shared+threads arch=linux-rhel6-x86_64
[+]                  ^sqlite@3.23.1%gcc@4.8.2~functions arch=linux-rhel6-x86_64
[+]          ^py-six@1.11.0%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]      ^py-dateutil@2.5.2%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]      ^py-kiwisolver@1.0.1%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]      ^py-numpy@1.15.2%gcc@4.8.2+blas+lapack arch=linux-rhel6-x86_64
[+]          ^openblas@0.3.3%gcc@4.8.2 cpu_target= ~ilp64 patches=47cfa7a952ac7b2e4632c73ae199d69fb54490627b66a62c681e21019c4ddc9d,714aea33692304a50bd0ccde42590c176c82ded4a8ac7f06e573dc8071929c33 +pic+shared threads=none ~virtual_machine arch=linux-rhel6-x86_64
[+]      ^py-pillow@5.1.0%gcc@4.8.2~freetype+jpeg~jpeg2000~lcms~tiff+zlib arch=linux-rhel6-x86_64
[+]          ^binutils@2.31.1%gcc@4.8.2+gold~libiberty+nls~plugins arch=linux-rhel6-x86_64
[+]              ^gettext@0.19.8.1%gcc@4.8.2+bzip2+curses+git~libunistring+libxml2 patches=9acdb4e73f67c241b5ef32505c9ddf7cf6884ca8ea661692f21dca28483b04b8 +tar+xz arch=linux-rhel6-x86_64
[+]                  ^libxml2@2.9.8%gcc@4.8.2~python arch=linux-rhel6-x86_64
[+]                      ^xz@5.2.4%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]                  ^tar@1.30%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]          ^libjpeg-turbo@1.5.90%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]              ^cmake@3.12.3%gcc@4.8.2~doc+ncurses+openssl+ownlibs patches=dd3a40d4d92f6b2158b87d6fb354c277947c776424aa03f6dc8096cf3135f5d0 ~qt arch=linux-rhel6-x86_64
[+]              ^nasm@2.13.03%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]      ^py-pyparsing@2.2.0%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]      ^py-pytz@2017.2%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]      ^qhull@2015.2%gcc@4.8.2 build_type=RelWithDebInfo patches=10ddc62a1600b0ede23fb0502e29dca389d18689fd8dfe7a849e3a989c0e607e arch=linux-rhel6-x86_64
[+]      ^tk@8.6.8%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]          ^libx11@1.6.5%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]              ^inputproto@2.3.2%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]                  ^util-macros@1.19.1%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]              ^kbproto@1.0.7%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]              ^libxcb@1.13%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]                  ^libpthread-stubs@0.4%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]                  ^libxau@1.0.8%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]                      ^xproto@7.0.31%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]                  ^libxdmcp@1.1.2%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]                  ^xcb-proto@1.13%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]              ^xextproto@7.3.0%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]              ^xtrans@1.3.5%gcc@4.8.2 arch=linux-rhel6-x86_64
[+]          ^tcl@8.6.8%gcc@4.8.2 arch=linux-rhel6-x86_64

Python 3.7.3 successfully installed but fails for matplotlib

@ThrashinVictim
Copy link
Author

Do you need any more info?

Thanks.

@citibeth
Copy link
Member

You need to use #7926

@citibeth
Copy link
Member

citibeth commented May 13, 2019

...then you need to turn on the +python3 variant for all packages (see all: in spack.yaml). See here for an example:
https://github.com/citibeth/spack/blob/efischer/giss2/var/spack/environments/configs/discover.yaml

@ThrashinVictim
Copy link
Author

Thanks for this but when creating an env
I edited the spack.yaml file and added
all:
variants: [+python3]

to the bottom
But when I run spack find

I get

File "/shared/spack/bin/spack", line 48, in
sys.exit(spack.main.main())
File "/shared/spack/lib/spack/spack/main.py", line 605, in main
env = ev.find_environment(args)
File "/shared/spack/lib/spack/spack/environment.py", line 182, in find_environment
return Environment(env)
File "/shared/spack/lib/spack/spack/environment.py", line 365, in init
self._read_manifest(f)
File "/shared/spack/lib/spack/spack/environment.py", line 377, in _read_manifest
self.yaml = _read_yaml(f)
File "/shared/spack/lib/spack/spack/environment.py", line 316, in _read_yaml
data = ruamel.yaml.load(str_or_file, ruamel.yaml.RoundTripLoader)
File "/shared/spack/lib/spack/external/ruamel/yaml/main.py", line 75, in load
return loader.get_single_data()
File "/shared/spack/lib/spack/external/ruamel/yaml/constructor.py", line 60, in get_single_data
node = self.get_single_node()
File "/shared/spack/lib/spack/external/ruamel/yaml/composer.py", line 53, in get_single_node
document = self.compose_document()
File "/shared/spack/lib/spack/external/ruamel/yaml/composer.py", line 73, in compose_document
node = self.compose_node(None, None)
File "/shared/spack/lib/spack/external/ruamel/yaml/composer.py", line 104, in compose_node
node = self.compose_mapping_node(anchor)
File "/shared/spack/lib/spack/external/ruamel/yaml/composer.py", line 163, in compose_mapping_node
item_value = self.compose_node(node, item_key)
File "/shared/spack/lib/spack/external/ruamel/yaml/composer.py", line 104, in compose_node
node = self.compose_mapping_node(anchor)
File "/shared/spack/lib/spack/external/ruamel/yaml/composer.py", line 156, in compose_mapping_node
while not self.check_event(MappingEndEvent):
File "/shared/spack/lib/spack/external/ruamel/yaml/parser.py", line 116, in check_event
self.current_event = self.state()
File "/shared/spack/lib/spack/external/ruamel/yaml/parser.py", line 505, in parse_block_mapping_key
token.start_mark)
ruamel.yaml.parser.ParserError: while parsing a block mapping
in "/shared/spack/var/spack/environments/Flpoly/spack.yaml", line 7, column 3
expected , but found ''
in "/shared/spack/var/spack/environments/Flpoly/spack.yaml", line 9, column 5
[root@login-florida-poly environments]#
[root@login-florida-poly environments]# clear
[root@login-florida-poly environments]# spack find
Traceback (most recent call last):
File "/shared/spack/bin/spack", line 48, in
sys.exit(spack.main.main())
File "/shared/spack/lib/spack/spack/main.py", line 605, in main
env = ev.find_environment(args)
File "/shared/spack/lib/spack/spack/environment.py", line 182, in find_environment
return Environment(env)
File "/shared/spack/lib/spack/spack/environment.py", line 365, in init
self._read_manifest(f)
File "/shared/spack/lib/spack/spack/environment.py", line 377, in _read_manifest
self.yaml = _read_yaml(f)
File "/shared/spack/lib/spack/spack/environment.py", line 316, in _read_yaml
data = ruamel.yaml.load(str_or_file, ruamel.yaml.RoundTripLoader)
File "/shared/spack/lib/spack/external/ruamel/yaml/main.py", line 75, in load
return loader.get_single_data()
File "/shared/spack/lib/spack/external/ruamel/yaml/constructor.py", line 60, in get_single_data
node = self.get_single_node()
File "/shared/spack/lib/spack/external/ruamel/yaml/composer.py", line 53, in get_single_node
document = self.compose_document()
File "/shared/spack/lib/spack/external/ruamel/yaml/composer.py", line 73, in compose_document
node = self.compose_node(None, None)
File "/shared/spack/lib/spack/external/ruamel/yaml/composer.py", line 104, in compose_node
node = self.compose_mapping_node(anchor)
File "/shared/spack/lib/spack/external/ruamel/yaml/composer.py", line 163, in compose_mapping_node
item_value = self.compose_node(node, item_key)
File "/shared/spack/lib/spack/external/ruamel/yaml/composer.py", line 104, in compose_node
node = self.compose_mapping_node(anchor)
File "/shared/spack/lib/spack/external/ruamel/yaml/composer.py", line 156, in compose_mapping_node
while not self.check_event(MappingEndEvent):
File "/shared/spack/lib/spack/external/ruamel/yaml/parser.py", line 116, in check_event
self.current_event = self.state()
File "/shared/spack/lib/spack/external/ruamel/yaml/parser.py", line 505, in parse_block_mapping_key
token.start_mark)
ruamel.yaml.parser.ParserError: while parsing a block mapping
in "/shared/spack/var/spack/environments/Flpoly/spack.yaml", line 7, column 3
expected , but found ''
in "/shared/spack/var/spack/environments/Flpoly/spack.yaml", line 9, column 5

I noticed in your example the file is called discover.yaml

@citibeth
Copy link
Member

I noticed in your example the file is called discover.yaml

My example uses Spack Environments; looks like you're using that too. Here is the main environment file, which links to the config file:

https://github.com/citibeth/spack/blob/efischer/giss2/var/spack/environments/oneway-discover/spack.yaml

It looks to me like you're tackling environments and Python3 all at the same time. It might be easier to do one at a time. You should be able to put this in your ~/.spack/packages.yaml file:

packages:
  python:
     version: [3.7]
  all:
     variants: [+python3]

Then you should be able to successfully do spack spec py-matplotlib. Then I would try to get the same thing working in an environment.

Even without messing with YAML files, you should be able to do spack spec py-matplotlib+python3^python@3.7

@tgamblin We REALLY need to get serious about supporting Python3 without jumping through hoops.

@ThrashinVictim
Copy link
Author

Thank you again. But when I added that and ran spack spec py-matplotlib it gives me

==> Error: An unsatisfiable version constraint has been detected for spec:

python@2.7.15%gcc@4.8.2+dbm~optimizations+pic+pythoncmd+shared~tk~ucs4 arch=linux-rhel6-x86_64
    ^bzip2@1.0.6%gcc@4.8.2+shared arch=linux-rhel6-x86_64
        ^diffutils@3.6%gcc@4.8.2 arch=linux-rhel6-x86_64
    ^gdbm@1.14.1%gcc@4.8.2 arch=linux-rhel6-x86_64
        ^readline@7.0%gcc@4.8.2 arch=linux-rhel6-x86_64
            ^ncurses@6.1%gcc@4.8.2~symlinks~termlib arch=linux-rhel6-x86_64
                ^pkgconf@1.4.2%gcc@4.8.2 arch=linux-rhel6-x86_64
    ^openssl@1.0.2o%gcc@4.8.2+systemcerts arch=linux-rhel6-x86_64
        ^perl@5.26.2%gcc@4.8.2+cpanm+shared+threads arch=linux-rhel6-x86_64
        ^zlib@1.2.11%gcc@4.8.2+optimize+pic+shared arch=linux-rhel6-x86_64
    ^sqlite@3.23.1%gcc@4.8.2~functions arch=linux-rhel6-x86_64

while trying to concretize the partial spec:

py-matplotlib@3.0.0%gcc@4.8.2~animation+image~ipython~latex~qt+tk arch=linux-rhel6-x86_64
    ^freetype@2.9.1%gcc@4.8.2 arch=linux-rhel6-x86_64
        ^bzip2@1.0.6%gcc@4.8.2+shared arch=linux-rhel6-x86_64
            ^diffutils@3.6%gcc@4.8.2 arch=linux-rhel6-x86_64
        ^libpng@1.6.34%gcc@4.8.2 arch=linux-rhel6-x86_64
            ^zlib@1.2.11%gcc@4.8.2+optimize+pic+shared arch=linux-rhel6-x86_64
        ^pkgconf@1.4.2%gcc@4.8.2 arch=linux-rhel6-x86_64
    ^pil
    ^py-dateutil@2.5.2%gcc@4.8.2 arch=linux-rhel6-x86_64
        ^py-setuptools@40.4.3%gcc@4.8.2 arch=linux-rhel6-x86_64
            ^python@2.7.15%gcc@4.8.2+dbm~optimizations+pic+pythoncmd+shared~tk~ucs4 arch=linux-rhel6-x86_64
                ^gdbm@1.14.1%gcc@4.8.2 arch=linux-rhel6-x86_64
                    ^readline@7.0%gcc@4.8.2 arch=linux-rhel6-x86_64
                        ^ncurses@6.1%gcc@4.8.2~symlinks~termlib arch=linux-rhel6-x86_64
                ^openssl@1.0.2o%gcc@4.8.2+systemcerts arch=linux-rhel6-x86_64
                    ^perl@5.26.2%gcc@4.8.2+cpanm+shared+threads arch=linux-rhel6-x86_64
                ^sqlite@3.23.1%gcc@4.8.2~functions arch=linux-rhel6-x86_64
        ^py-six@1.11.0%gcc@4.8.2 arch=linux-rhel6-x86_64
    ^qhull@2015.2%gcc@4.8.2 build_type=RelWithDebInfo arch=linux-rhel6-x86_64
        ^cmake@3.12.3%gcc@4.8.2~doc+ncurses+openssl+ownlibs~qt arch=linux-rhel6-x86_64
    ^tk@8.3:
        ^libx11
            ^inputproto
                ^util-macros
            ^kbproto
            ^libxcb@1.1.92:
                ^libpthread-stubs
                ^libxau@0.99.2:
                    ^xproto@7.0.17:
                ^libxdmcp
                ^xcb-proto
            ^xextproto
            ^xtrans
        ^tcl@8.6:

py-matplotlib requires python version 3.7.3:, but spec asked for 2.7.15

@citibeth
Copy link
Member

@liamrpowell I just did the following (on my Mac; but Linux should be about the same). Use for ~/.spack/packages.yaml:

packages:
    python:
        version: [3.6]
    all:
        variants: [+python3]

Then:

git clone git@github.com:citibeth/spack.git -b efischer/giss2
cd spack
bin/spack compiler find
bin/spack spec py-matplotlib

Result is:

Input spec
--------------------------------
py-matplotlib

Concretized
--------------------------------
py-matplotlib@3.0.0%clang@10.0.1-apple~animation+image~ipython~latex+python3~qt+tk arch=darwin-mojave-x86_64 
    ^freetype@2.9.1%clang@10.0.1-apple patches=08466355e8649235ff01f13b3e56bbd551c7cfb2ca97903cc11575c163ea32a3 arch=darwin-mojave-x86_64 
        ^bzip2@1.0.6%clang@10.0.1-apple+shared arch=darwin-mojave-x86_64 
            ^diffutils@3.6%clang@10.0.1-apple arch=darwin-mojave-x86_64 
        ^libpng@1.6.34%clang@10.0.1-apple arch=darwin-mojave-x86_64 
            ^zlib@1.2.11%clang@10.0.1-apple+optimize+pic+shared arch=darwin-mojave-x86_64 
        ^pkgconf@1.5.4%clang@10.0.1-apple arch=darwin-mojave-x86_64 
    ^py-cycler@0.10.0%clang@10.0.1-apple arch=darwin-mojave-x86_64 
        ^py-setuptools@40.4.3%clang@10.0.1-apple arch=darwin-mojave-x86_64 
            ^python@3.6.5%clang@10.0.1-apple+dbm~optimizations patches=123082ab3483ded78e86d7c809e98a804b3465b4683c96bd79a2fd799f572244 +pic+pythoncmd~shared~tk~ucs4 arch=darwin-mojave-x86_64 
                ^gdbm@1.18.1%clang@10.0.1-apple arch=darwin-mojave-x86_64 
                    ^readline@7.0%clang@10.0.1-apple arch=darwin-mojave-x86_64 
                        ^ncurses@6.1%clang@10.0.1-apple~symlinks~termlib arch=darwin-mojave-x86_64 
                ^openssl@1.1.1%clang@10.0.1-apple+systemcerts arch=darwin-mojave-x86_64 
                    ^perl@5.26.2%clang@10.0.1-apple+cpanm patches=0eac10ed90aeb0459ad8851f88081d439a4e41978e586ec743069e8b059370ac +shared+threads arch=darwin-mojave-x86_64 
                ^sqlite@3.26.0%clang@10.0.1-apple~functions arch=darwin-mojave-x86_64 
        ^py-six@1.11.0%clang@10.0.1-apple arch=darwin-mojave-x86_64 
    ^py-dateutil@2.5.2%clang@10.0.1-apple arch=darwin-mojave-x86_64 
    ^py-kiwisolver@1.0.1%clang@10.0.1-apple arch=darwin-mojave-x86_64 
    ^py-numpy@1.15.2%clang@10.0.1-apple+blas+lapack arch=darwin-mojave-x86_64 
        ^openblas@0.3.5%clang@10.0.1-apple cpu_target=auto ~ilp64+pic+shared threads=none ~virtual_machine arch=darwin-mojave-x86_64 
    ^py-pillow@5.1.0%clang@10.0.1-apple~freetype+jpeg~jpeg2000~lcms~tiff+zlib arch=darwin-mojave-x86_64 
        ^libjpeg-turbo@1.5.90%clang@10.0.1-apple arch=darwin-mojave-x86_64 
            ^cmake@3.13.3%clang@10.0.1-apple~doc+ncurses+openssl+ownlibs~qt arch=darwin-mojave-x86_64 
            ^nasm@2.13.03%clang@10.0.1-apple arch=darwin-mojave-x86_64 
    ^py-pyparsing@2.2.0%clang@10.0.1-apple arch=darwin-mojave-x86_64 
    ^py-pytz@2017.2%clang@10.0.1-apple arch=darwin-mojave-x86_64 
    ^qhull@2015.2%clang@10.0.1-apple build_type=RelWithDebInfo patches=10ddc62a1600b0ede23fb0502e29dca389d18689fd8dfe7a849e3a989c0e607e arch=darwin-mojave-x86_64 
    ^tk@8.6.8%clang@10.0.1-apple arch=darwin-mojave-x86_64 
        ^libx11@1.6.5%clang@10.0.1-apple arch=darwin-mojave-x86_64 
            ^inputproto@2.3.2%clang@10.0.1-apple arch=darwin-mojave-x86_64 
                ^util-macros@1.19.1%clang@10.0.1-apple arch=darwin-mojave-x86_64 
            ^kbproto@1.0.7%clang@10.0.1-apple arch=darwin-mojave-x86_64 
            ^libxcb@1.13%clang@10.0.1-apple+python3 arch=darwin-mojave-x86_64 
                ^libpthread-stubs@0.4%clang@10.0.1-apple arch=darwin-mojave-x86_64 
                ^libxau@1.0.8%clang@10.0.1-apple arch=darwin-mojave-x86_64 
                    ^xproto@7.0.31%clang@10.0.1-apple arch=darwin-mojave-x86_64 
                ^libxdmcp@1.1.2%clang@10.0.1-apple arch=darwin-mojave-x86_64 
                    ^libbsd@0.9.1%clang@10.0.1-apple arch=darwin-mojave-x86_64 
                ^xcb-proto@1.13%clang@10.0.1-apple+python3 arch=darwin-mojave-x86_64 
            ^xextproto@7.3.0%clang@10.0.1-apple arch=darwin-mojave-x86_64 
            ^xtrans@1.3.5%clang@10.0.1-apple arch=darwin-mojave-x86_64 
        ^tcl@8.6.8%clang@10.0.1-apple arch=darwin-mojave-x86_64 

If my for of Spack works for you, feel free to use it. Sorry I don't have more time to make this work on the latest Spack develop (if that's the issue; or maybe it's just a problem with your packages.yaml). I have spent considerable time today seeing if we can get the ball rolling on solving this problem once and for all (see #11468). You shouldn't have to be going through weird incantations to get it to work.

@scheibelp
Copy link
Member

@citibeth I'm confused: I don't see anything in

which mentions the error

640 /opt/rh/devtoolset-2/root/usr/libexec/gcc/x86_64-redhat-linux/4.8.2
/ld: /usr/local/lib/libpython3.7m.a(bytesobject.o): relocation R_X86_64_32 against `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC
641 /usr/local/lib/libpython3.7m.a: could not read symbols: Bad value

and furthermore I was able to install py-matplotlib ^python@3: on a RHEL7 system without having to make any changes.

I am more inclined to suspect this is an issue with py-matplotib's build system insisting on using a system Python (and one that was built without --enable-shared). I've had similar issues with py-numpy (see: #10383) trying to use externally-installed libraries (not Python specifically). Admittedly I don't see anything for that looking through https://raw.githubusercontent.com/matplotlib/matplotlib/master/setup.cfg.template quickly.

@citibeth
Copy link
Member

Sorry, I don't know what the problem is. It works for me using the repo I shared above, on CentOS7.

@scheibelp
Copy link
Member

@liamrpowell could you attach the following files (running with a "fresh" Spack configuration, after reproducing the installation error):

  • The spack-build.log that appears in the staging directory (you can spack cd py-matplotlib ^python@3: to CWD to the directory with that file after a failed build).
  • The full output of spack spec py-matplotlib ^python@3:?
  • Looking at the py-matplotlib documentation (https://matplotlib.org/3.0.2/users/installing.html) there appears to be a separate (not Spack-maintained) log - could you include that as well?

@ThrashinVictim
Copy link
Author

ThrashinVictim commented May 18, 2019 via email

@ThrashinVictim
Copy link
Author

Fresh install.
I followed the instructions here.
https://spack.readthedocs.io/en/latest/tutorial_basics.html

did spack install py-matplotlib^python@3:
Here is the log

==> Error: An unsatisfiable version constraint has been detected for spec:

python@2.7.15%gcc@4.8.2+dbm~optimizations+pic+pythoncmd+shared~tk~ucs4 arch=linux-rhel6-x86_64
    ^bzip2@1.0.6%gcc@4.8.2+shared arch=linux-rhel6-x86_64
        ^diffutils@3.6%gcc@4.8.2 arch=linux-rhel6-x86_64
    ^gdbm@1.14.1%gcc@4.8.2 arch=linux-rhel6-x86_64
        ^readline@7.0%gcc@4.8.2 arch=linux-rhel6-x86_64
            ^ncurses@6.1%gcc@4.8.2~symlinks~termlib arch=linux-rhel6-x86_64
                ^pkgconf@1.4.2%gcc@4.8.2 arch=linux-rhel6-x86_64
    ^openssl@1.0.2o%gcc@4.8.2+systemcerts arch=linux-rhel6-x86_64
        ^perl@5.26.2%gcc@4.8.2+cpanm+shared+threads arch=linux-rhel6-x86_64
        ^zlib@1.2.11%gcc@4.8.2+optimize+pic+shared arch=linux-rhel6-x86_64
    ^sqlite@3.23.1%gcc@4.8.2~functions arch=linux-rhel6-x86_64

while trying to concretize the partial spec:

py-matplotlib@3.0.0%gcc@4.8.2~animation+image~ipython~latex~qt+tk arch=linux-rhel6-x86_64
    ^freetype@2.9.1%gcc@4.8.2 arch=linux-rhel6-x86_64
        ^bzip2@1.0.6%gcc@4.8.2+shared arch=linux-rhel6-x86_64
            ^diffutils@3.6%gcc@4.8.2 arch=linux-rhel6-x86_64
        ^libpng@1.6.34%gcc@4.8.2 arch=linux-rhel6-x86_64
            ^zlib@1.2.11%gcc@4.8.2+optimize+pic+shared arch=linux-rhel6-x86_64
        ^pkgconf@1.4.2%gcc@4.8.2 arch=linux-rhel6-x86_64
    ^pil
    ^py-dateutil@2.5.2%gcc@4.8.2 arch=linux-rhel6-x86_64
        ^py-setuptools@40.4.3%gcc@4.8.2 arch=linux-rhel6-x86_64
            ^python@2.7.15%gcc@4.8.2+dbm~optimizations+pic+pythoncmd+shared~tk~ucs4 arch=linux-rhel6-x86_64
                ^gdbm@1.14.1%gcc@4.8.2 arch=linux-rhel6-x86_64
                    ^readline@7.0%gcc@4.8.2 arch=linux-rhel6-x86_64
                        ^ncurses@6.1%gcc@4.8.2~symlinks~termlib arch=linux-rhel6-x86_64
                ^openssl@1.0.2o%gcc@4.8.2+systemcerts arch=linux-rhel6-x86_64
                    ^perl@5.26.2%gcc@4.8.2+cpanm+shared+threads arch=linux-rhel6-x86_64
                ^sqlite@3.23.1%gcc@4.8.2~functions arch=linux-rhel6-x86_64
        ^py-six@1.11.0%gcc@4.8.2 arch=linux-rhel6-x86_64
    ^py-functools32@3.2.3-2%gcc@4.8.2 arch=linux-rhel6-x86_64
    ^py-subprocess32@3.2.7%gcc@4.8.2 arch=linux-rhel6-x86_64
    ^qhull@2015.2%gcc@4.8.2 build_type=RelWithDebInfo arch=linux-rhel6-x86_64
        ^cmake@3.12.3%gcc@4.8.2~doc+ncurses+openssl+ownlibs~qt arch=linux-rhel6-x86_64
    ^tk@8.3:
        ^libx11
            ^inputproto
                ^util-macros
            ^kbproto
            ^libxcb@1.1.92:
                ^libpthread-stubs
                ^libxau@0.99.2:
                    ^xproto@7.0.17:
                ^libxdmcp
                ^xcb-proto
            ^xextproto
            ^xtrans
        ^tcl@8.6:

py-matplotlib requires python version 3.5:, but spec asked for 2.7.15

spack spec py-matplotlib ^python@3:

Input spec

py-matplotlib
^python@3:

Concretized

py-matplotlib@3.0.0%gcc@4.8.2animation+imageipythonlatexqt+tk arch=linux-rhel6-x86_64
^freetype@2.9.1%gcc@4.8.2 arch=linux-rhel6-x86_64
^bzip2@1.0.6%gcc@4.8.2+shared arch=linux-rhel6-x86_64
^diffutils@3.6%gcc@4.8.2 arch=linux-rhel6-x86_64
^libpng@1.6.34%gcc@4.8.2 arch=linux-rhel6-x86_64
^zlib@1.2.11%gcc@4.8.2+optimize+pic+shared arch=linux-rhel6-x86_64
^pkgconf@1.4.2%gcc@4.8.2 arch=linux-rhel6-x86_64
^py-cycler@0.10.0%gcc@4.8.2 arch=linux-rhel6-x86_64
^py-setuptools@40.4.3%gcc@4.8.2 arch=linux-rhel6-x86_64
^python@3.7.0%gcc@4.8.2+dbmoptimizations patches=123082ab3483ded78e86d7c809e98a804b3465b4683c96bd79a2fd799f572244 +pic+pythoncmd+sharedtkucs4 arch=linux-rhel6-x86_64
^gdbm@1.14.1%gcc@4.8.2 arch=linux-rhel6-x86_64
^readline@7.0%gcc@4.8.2 arch=linux-rhel6-x86_64
^ncurses@6.1%gcc@4.8.2
symlinkstermlib arch=linux-rhel6-x86_64
^libffi@3.2.1%gcc@4.8.2 arch=linux-rhel6-x86_64
^openssl@1.0.2o%gcc@4.8.2+systemcerts arch=linux-rhel6-x86_64
^perl@5.26.2%gcc@4.8.2+cpanm patches=0eac10ed90aeb0459ad8851f88081d439a4e41978e586ec743069e8b059370ac +shared+threads arch=linux-rhel6-x86_64
^sqlite@3.23.1%gcc@4.8.2
functions arch=linux-rhel6-x86_64
^py-six@1.11.0%gcc@4.8.2 arch=linux-rhel6-x86_64
^py-dateutil@2.5.2%gcc@4.8.2 arch=linux-rhel6-x86_64
^py-kiwisolver@1.0.1%gcc@4.8.2 arch=linux-rhel6-x86_64
^py-numpy@1.15.2%gcc@4.8.2+blas+lapack arch=linux-rhel6-x86_64
^openblas@0.3.3%gcc@4.8.2 cpu_target= ilp64 patches=47cfa7a952ac7b2e4632c73ae199d69fb54490627b66a62c681e21019c4ddc9d,714aea33692304a50bd0ccde42590c176c82ded4a8ac7f06e573dc8071929c33 +pic+shared threads=none virtual_machine arch=linux-rhel6-x86_64
^py-pillow@5.1.0%gcc@4.8.2
freetype+jpeg
jpeg2000lcmstiff+zlib arch=linux-rhel6-x86_64
^binutils@2.31.1%gcc@4.8.2+goldlibiberty+nlsplugins arch=linux-rhel6-x86_64
^gettext@0.19.8.1%gcc@4.8.2+bzip2+curses+gitlibunistring+libxml2 patches=9acdb4e73f67c241b5ef32505c9ddf7cf6884ca8ea661692f21dca28483b04b8 +tar+xz arch=linux-rhel6-x86_64
^libxml2@2.9.8%gcc@4.8.2
python arch=linux-rhel6-x86_64
^xz@5.2.4%gcc@4.8.2 arch=linux-rhel6-x86_64
^tar@1.30%gcc@4.8.2 arch=linux-rhel6-x86_64
^libjpeg-turbo@1.5.90%gcc@4.8.2 arch=linux-rhel6-x86_64
^cmake@3.12.3%gcc@4.8.2~doc+ncurses+openssl+ownlibs patches=dd3a40d4d92f6b2158b87d6fb354c277947c776424aa03f6dc8096cf3135f5d0 ~qt arch=linux-rhel6-x86_64
^nasm@2.13.03%gcc@4.8.2 arch=linux-rhel6-x86_64
^py-pyparsing@2.2.0%gcc@4.8.2 arch=linux-rhel6-x86_64
^py-pytz@2017.2%gcc@4.8.2 arch=linux-rhel6-x86_64
^qhull@2015.2%gcc@4.8.2 build_type=RelWithDebInfo patches=10ddc62a1600b0ede23fb0502e29dca389d18689fd8dfe7a849e3a989c0e607e arch=linux-rhel6-x86_64
^tk@8.6.8%gcc@4.8.2 arch=linux-rhel6-x86_64
^libx11@1.6.5%gcc@4.8.2 arch=linux-rhel6-x86_64
^inputproto@2.3.2%gcc@4.8.2 arch=linux-rhel6-x86_64
^util-macros@1.19.1%gcc@4.8.2 arch=linux-rhel6-x86_64
^kbproto@1.0.7%gcc@4.8.2 arch=linux-rhel6-x86_64
^libxcb@1.13%gcc@4.8.2 arch=linux-rhel6-x86_64
^libpthread-stubs@0.4%gcc@4.8.2 arch=linux-rhel6-x86_64
^libxau@1.0.8%gcc@4.8.2 arch=linux-rhel6-x86_64
^xproto@7.0.31%gcc@4.8.2 arch=linux-rhel6-x86_64
^libxdmcp@1.1.2%gcc@4.8.2 arch=linux-rhel6-x86_64
^xcb-proto@1.13%gcc@4.8.2 arch=linux-rhel6-x86_64
^xextproto@7.3.0%gcc@4.8.2 arch=linux-rhel6-x86_64
^xtrans@1.3.5%gcc@4.8.2 arch=linux-rhel6-x86_64
^tcl@8.6.8%gcc@4.8.2 arch=linux-rhel6-x86_64

@citibeth
Copy link
Member

Something in your concretization requires Python 2.7. Could it be one of these packages??? I would check libxcb.

catalyst/package.py:    depends_on('python@2:2.8', when='+python', type=("build", "link", "run"))
catalyst/package.py:        # - python bits under lib/python2.8/site-packages
cmor/package.py:    depends_on('python@:2.8', when='+python')
elemental/package.py:    depends_on('python@:2.8', when='+python')
gdl/package.py:    depends_on('python@2.7:2.8', type=('build', 'run'), when='+embed_python')
graphviz/package.py:    depends_on('python@2:2.8', when='+python')
hic-pro/package.py:    depends_on('python+ucs4@2.7:2.8')
julia/package.py:    depends_on("python@2.7:2.8")
libxcb/package.py:    # depends_on('python@2:2.8', when='@:1.12', type='build')
llvm/package.py:    depends_on('python@2.7:2.8', when='@:4.999')
mercurial/package.py:    depends_on('python@2.6:2.8', when='@:4.2.99')
mozjs/package.py:    depends_on('python@2.7.3:2.8', type='build')
node-js/package.py:    depends_on('python@2.7:2.8', type='build')
nwchem/package.py:    depends_on('python@2.7:2.8', type=('build', 'link', 'run'))
paraview/package.py:    depends_on('python@2:2.8', when='+python')
paraview/package.py:        # - python bits under lib/python2.8/site-packages
pism/package.py:    depends_on('python@2.7:2.8', when='+python')
plplot/package.py:    depends_on('python@2.7:2.8', type=('build', 'run'), when='+python')
py-bokeh/package.py:        when='^python@2.7:2.8')
py-cdat-lite/package.py:    depends_on("python@2.5:2.8", type=('build', 'run'))
py-doxypy/package.py:    depends_on('python@:2.8')
py-easybuild-framework/package.py:    depends_on('python@2.6:2.8', type='run')
py-entrypoints/package.py:    depends_on('py-configparser', when='^python@:2.8', type=('build', 'run'))
py-espressopp/package.py:    depends_on("python@2:2.8")
py-macs2/package.py:    depends_on('python@2.7:2.8')
py-opentuner/package.py:    depends_on('python@2.7:2.8', type=('build', 'run'))
py-pil/package.py:    depends_on('python@1.5.2:2.8')
rust/package.py:    depends_on("python@:2.8")
shiny-server/package.py:    depends_on('python@:2.8')  # docs say: "Really.  3.x will not work"
simulationio/package.py:    depends_on('python@2.7:2.8', when='+python', type=('build', 'run'))
slepc/package.py:    depends_on('python@2.6:2.8', type='build')
stat/package.py:    depends_on('python@:2.8', when='@:4.0.0')

Can you start out with the fork I recommend above, and put in the right packages.yaml stuff for Python3, and see if THAT works?

@ThrashinVictim
Copy link
Author

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

On your fork you provided.

@citibeth
Copy link
Member

citibeth commented May 20, 2019 via email

@citibeth
Copy link
Member

citibeth commented May 20, 2019 via email

@citibeth
Copy link
Member

citibeth commented May 20, 2019 via email

@ThrashinVictim
Copy link
Author

ThrashinVictim commented May 20, 2019

Ok i cloned your git.

Then added the python to spack/defaults/packages.yaml

packages:
python:
     version: [3.7]
all: 
    compiler: [gcc, intel, pgi, clang, xl, nag]
    providers:
      D: [ldc]
      awk: [gawk]
      blas: [openblas]
      daal: [intel-daal]
      elf: [elfutils]
      fftw-api: [fftw]
      gl: [mesa, opengl]
      glu: [mesa-glu, openglu]
      golang: [gcc]
      ipp: [intel-ipp]
      java: [jdk]
      jpeg: [libjpeg-turbo, libjpeg]
      lapack: [openblas]
      mkl: [intel-mkl]
      mpe: [mpe2]
      mpi: [openmpi, mpich]
      opencl: [pocl]
      openfoam: [openfoam-com, openfoam-org, foam-extend]
      pil: [py-pillow]
      pkgconfig: [pkgconf, pkg-config]
      scalapack: [netlib-scalapack]
      szip: [libszip, libaec]
      tbb: [intel-tbb]
      unwind: [libunwind]
      variants: [+python3]
    permissions:
      read: world
      write: user

then ran

spack spec py-matplotlib ^python@3:

and get

Error: /shared/spack/etc/spack/defaults/packages.yaml:16: Additional properties are not allowed ('python', 'all' were unexpected)
so my packages.yaml is wrong somehow.

@citibeth
Copy link
Member

All the lines except the first need to be indented an additional indent.

@ThrashinVictim
Copy link
Author

all seemed to be going well until ran into this
==> Error: ProcessError: Command exited with status 1:
'/shared/spack/var/spack/stage/tar-1.30-b5bt4ly2qk7amnlvq633txt2un3ldl6j/tar-1.30/configure' '--prefix=/shared/spack/opt/spack/linux-rhel6-x86_64/gcc-4.8.2/tar-1.30-b5bt4ly2qk7amnlvq633txt2un3ldl6j'

2 errors found in build log:
484 checking for mempcpy... (cached) yes
485 checking for memrchr... yes
486 checking whether mkdir handles trailing slash... yes
487 checking whether mkdir handles trailing dot... yes
488 checking for mkdtemp... yes
489 checking whether mkfifo rejects trailing slashes... yes

490 checking whether mknod can create fifo without root privileges... c
onfigure: error: in /tmp/root/spack-stage/spack-stage-QZVi3T/tar-1 .30': 491 configure: error: you should not run configure as root (set FORCE_U NSAFE_CONFIGURE=1 in environment to bypass this check) 492 See config.log' for more details

See build log for details:
/shared/spack/var/spack/stage/tar-1.30-b5bt4ly2qk7amnlvq633txt2un3ldl6j/tar-1.30/spack-build.out

@ThrashinVictim
Copy link
Author

I did try set FORCE_UNSAFE_CONFIGURE=1 btw

@citibeth
Copy link
Member

Wait a minute... are you running Spack as root or with sudo? Spack is meant to be run from unprivileged user accounts.

@citibeth
Copy link
Member

I did try set FORCE_UNSAFE_CONFIGURE=1 btw

No, please don't do this.

@ThrashinVictim
Copy link
Author

Ok let me try something else.

@ThrashinVictim
Copy link
Author

running it as sudo under my user account (not root)

@citibeth
Copy link
Member

citibeth commented May 20, 2019 via email

@ThrashinVictim
Copy link
Author

ThrashinVictim commented May 20, 2019

Ok I thought you had to run spack installl using sudo. My mistake.
I am running it now as a normal user account. Not sudo, not root and get this.
==> Error: [Errno 13] Permission denied: '/shared/spack/var/spack/junit-report'

@citibeth
Copy link
Member

Yes... because some files in /shared/spack were previously written by root, and now you can't overwrite them. Please start over COMPLETELY, starting with git cloneing a new Spack in ~/spack or some other part of your home directory. And delete /shared/spack.

@ThrashinVictim
Copy link
Author

What should the permissions on the spack folder be? This is for multiple users as it is in the /shared folder

@citibeth
Copy link
Member

citibeth commented May 20, 2019 via email

@ThrashinVictim
Copy link
Author

ThrashinVictim commented May 21, 2019

OK got further.

but ran into this error for Matplotlib.

==> Error: ProcessError: Command exited with status 1:
    '/shared/spack/opt/spack/linux-rhel6-x86_64/gcc-4.8.2/python-3.7.0-euuxqe3wuvgbivhanh4utyrvju2v6p4i/bin/python3.7' '-s' 'setup.py' '--no-user-cfg' 'build'

2 errors found in build log:
     636    /shared/spack/lib/spack/env/gcc/gcc -Wno-unused-result -Wsign-compa
            re -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -DMPL_DEVNULL=/dev/nul
            l -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib__qhull_ARRAY_API -DNPY_NO
            _DEPRECATED_API=NPY_1_7_API_VERSION -D__STDC_FORMAT_MACROS=1 -I/sha
            red/spack/opt/spack/linux-rhel6-x86_64/gcc-4.8.2/py-numpy-1.15.2-el
            id4xwklsv45w4gpku22ugd3xukhj7n/lib/python3.7/site-packages/numpy/co
            re/include -Iextern -I/usr/local/include -I/usr/include -I. -I/shar
            ed/spack/opt/spack/linux-rhel6-x86_64/gcc-4.8.2/python-3.7.0-euuxqe
            3wuvgbivhanh4utyrvju2v6p4i/include/python3.7m -c extern/libqhull/us
            ermem.c -o build/temp.linux-x86_64-3.7/extern/libqhull/usermem.o
     637    /shared/spack/lib/spack/env/gcc/gcc -Wno-unused-result -Wsign-compa
            re -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -DMPL_DEVNULL=/dev/nul
            l -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib__qhull_ARRAY_API -DNPY_NO
            _DEPRECATED_API=NPY_1_7_API_VERSION -D__STDC_FORMAT_MACROS=1 -I/sha
            red/spack/opt/spack/linux-rhel6-x86_64/gcc-4.8.2/py-numpy-1.15.2-el
            id4xwklsv45w4gpku22ugd3xukhj7n/lib/python3.7/site-packages/numpy/co
            re/include -Iextern -I/usr/local/include -I/usr/include -I. -I/shar
            ed/spack/opt/spack/linux-rhel6-x86_64/gcc-4.8.2/python-3.7.0-euuxqe
            3wuvgbivhanh4utyrvju2v6p4i/include/python3.7m -c extern/libqhull/us
            erprintf.c -o build/temp.linux-x86_64-3.7/extern/libqhull/userprint
            f.o
     638    /shared/spack/lib/spack/env/gcc/gcc -Wno-unused-result -Wsign-compa
            re -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -DMPL_DEVNULL=/dev/nul
            l -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib__qhull_ARRAY_API -DNPY_NO
            _DEPRECATED_API=NPY_1_7_API_VERSION -D__STDC_FORMAT_MACROS=1 -I/sha
            red/spack/opt/spack/linux-rhel6-x86_64/gcc-4.8.2/py-numpy-1.15.2-el
            id4xwklsv45w4gpku22ugd3xukhj7n/lib/python3.7/site-packages/numpy/co
            re/include -Iextern -I/usr/local/include -I/usr/include -I. -I/shar
            ed/spack/opt/spack/linux-rhel6-x86_64/gcc-4.8.2/python-3.7.0-euuxqe
            3wuvgbivhanh4utyrvju2v6p4i/include/python3.7m -c extern/libqhull/us
            erprintf_rbox.c -o build/temp.linux-x86_64-3.7/extern/libqhull/user
            printf_rbox.o
     639    /opt/rh/devtoolset-2/root/usr/bin/gcc -pthread -shared -L/shared/sp
            ack/opt/spack/linux-rhel6-x86_64/gcc-4.8.2/bzip2-1.0.6-hvitaawyhdh6
            sbcmr634ncxz27yd57cp/lib -L/shared/spack/opt/spack/linux-rhel6-x86_
            64/gcc-4.8.2/ncurses-6.1-mlilc2ss5fy3qofrcirv2hjcvppbhnax/lib -L/sh
            ared/spack/opt/spack/linux-rhel6-x86_64/gcc-4.8.2/zlib-1.2.11-7z2qz
            en7xxbgrxy5mijexrtcbtir6bwq/lib -L/shared/spack/opt/spack/linux-rhe
            l6-x86_64/gcc-4.8.2/sqlite-3.26.0-tuucjrgqfo5ixtj4qg2o6aby42jkjusj/
            lib -L/shared/spack/opt/spack/linux-rhel6-x86_64/gcc-4.8.2/openssl-
            1.1.1-yi2o74tamxc2jkirmuesa5x5nott6tur/lib -L/shared/spack/opt/spac
            k/linux-rhel6-x86_64/gcc-4.8.2/libffi-3.2.1-e57jbgj3pjadilvsmv2yubf
            opg6pu2mq/lib64 -L/shared/spack/opt/spack/linux-rhel6-x86_64/gcc-4.
            8.2/readline-7.0-tp3x4l67s74ffx6uo6obglqi2y3j4iyh/lib -L/shared/spa
            ck/opt/spack/linux-rhel6-x86_64/gcc-4.8.2/gdbm-1.18.1-nqyj6opqv4yoy
            szbb5woe5wmmiin2ugr/lib build/temp.linux-x86_64-3.7/src/qhull_wrap.
            o build/temp.linux-x86_64-3.7/extern/libqhull/geom.o build/temp.lin
            ux-x86_64-3.7/extern/libqhull/geom2.o build/temp.linux-x86_64-3.7/e
            xtern/libqhull/global.o build/temp.linux-x86_64-3.7/extern/libqhull
            /io.o build/temp.linux-x86_64-3.7/extern/libqhull/libqhull.o build/
            temp.linux-x86_64-3.7/extern/libqhull/mem.o build/temp.linux-x86_64
            -3.7/extern/libqhull/merge.o build/temp.linux-x86_64-3.7/extern/lib
            qhull/poly.o build/temp.linux-x86_64-3.7/extern/libqhull/poly2.o bu
            ild/temp.linux-x86_64-3.7/extern/libqhull/qset.o build/temp.linux-x
            86_64-3.7/extern/libqhull/random.o build/temp.linux-x86_64-3.7/exte
            rn/libqhull/rboxlib.o build/temp.linux-x86_64-3.7/extern/libqhull/s
            tat.o build/temp.linux-x86_64-3.7/extern/libqhull/user.o build/temp
            .linux-x86_64-3.7/extern/libqhull/usermem.o build/temp.linux-x86_64
            -3.7/extern/libqhull/userprintf.o build/temp.linux-x86_64-3.7/exter
            n/libqhull/userprintf_rbox.o -L/usr/local/lib -L/usr/local/lib64 -L
            /usr/lib -L/usr/lib64 -L/shared/spack/opt/spack/linux-rhel6-x86_64/
            gcc-4.8.2/python-3.7.0-euuxqe3wuvgbivhanh4utyrvju2v6p4i/lib -lm -lp
            ython3.7m -o build/lib.linux-x86_64-3.7/matplotlib/_qhull.cpython-3
            7m-x86_64-linux-gnu.so
     640    /opt/rh/devtoolset-2/root/usr/libexec/gcc/x86_64-redhat-linux/4.8.2
            /ld: /usr/local/lib/libpython3.7m.a(bytesobject.o): relocation R_X8
            6_64_32 against `_Py_NoneStruct' can not be used when making a shar
            ed object; recompile with -fPIC
     641    /usr/local/lib/libpython3.7m.a: could not read symbols: Bad value
  >> 642    collect2: error: ld returned 1 exit status
  >> 643    error: command '/opt/rh/devtoolset-2/root/usr/bin/gcc' failed with
            exit status 1

@citibeth
Copy link
Member

Please use triple-backquotes to quote your console output. Fixing up now so I can read it...

@citibeth
Copy link
Member

Problems I see here; hopefully someone else has a good idea on how to solve them:

  1. The compile commands use the Spack GCC wraper, as they should (/shared/spack/lib/spack/env/gcc/gcc). But then the link command fails to use the wrapper, and just goes straight to /opt/rh/devtoolset-2/root/usr/bin/gcc.

  2. The compile command line has -I/usr/local/include and the link command line has -L/usr/local/lib -L/usr/local/lib64. Same thing for /usr/include / /usr/lib[64]. This is the direct cause of your problem. The concretization you shared above shows that python was part of your build (DAG); but now you're switching to the system Python at the last minute. I don't know why it's doing this. Either you are (a) intentionally trying to build py-matplotlib with the system Python (don't); or (b) your environment is polluted. Case (b) is unlikely, since Spack cleans out the build environment unless you use spack --dirty. So I'm guessing it's (a).

Many / most useful Python stacks involve compiling C/C++ code (for example, py-numpy). You need to use the same compiler to build that code, as was used to build the original may Python installation. Because of this, and for other reasons, it's generally futile to try to use the system Python for your HPC work. The system Python is there for the OS; and you need to build your own Python for your work. Spack makes this easy and only takes a few minutes; so let it do its thing!

  1. I'm not convinced your compilers will work:
 did which gcc
/opt/rh/devtoolset-2/root/usr/bin/gcc

Then which gfortran
/usr/bin/gfortran

I found a website that had a person that had the same problem, and it states to change comilers.yaml.
But I tried changing the settings for cc gxx f77 and fc and it still did not find the compilers.

Most reliable would be to use a single GCC that includes all the languages you need. You can get this with spack install gcc+gfortran Notes: (a) remember to select the GCC version you want, (b) This does take a few hours. (c) Consider creating a new Spack instance just to build GCC. Because GCC is BIG and SLOW, and never changes once you get it installed. I've used this technique to avoid ever having to rebuild my GCC, even when I upgrade Spack / blow away Spack / etc. Or just as whoever did /opt/rh/devtooset-2 to re-do the build with gfortran; which is a less automated version of just asking Spack to do it.

"Mixed" compilers have been successful when combining Clang with Gfortran on macOS. But I'm worried about combining two differnt versions of GCC; more chance (in my mind) that their libraries or expacations might clash.

@ThrashinVictim
Copy link
Author

I will do the spack install gcc+gfortran

"intentionally trying to build py-matplotlib with the system Python (don't)"

When i tried to do spack spec py-matplotlib ^python@3:

is that forcing it to use the local Python install instead of the Python within spack?

@citibeth
Copy link
Member

citibeth commented May 21, 2019 via email

@ThrashinVictim
Copy link
Author

ThrashinVictim commented May 21, 2019

Ok here we go again.

trying to install GCC.

Error:` ProcessError: Command exited with status 2:

'make' '-j6'
6 errors found in build log:
9722 /tmp/wpowell/spack-stage/spack-stage-u_7lic/gcc-8.2.0/spack-build/
./prev-gcc/xg++ -B/tmp/wpowell/spack-stage/spack-stage-u_7lic/gcc-
8.2.0/spack-build/./prev-gcc/ -B/shared/spack/opt/spack/linux-rhel
6-x86_64/gcc-4.8.2/gcc-8.2.0-arepu3ta2xtlboacnuxk3su2h3oqc3lr/x86_
64-pc-linux-gnu/bin/ -nostdinc++ -B/tmp/wpowell/spack-stage/spack-
stage-u_7lic/gcc-8.2.0/spack-build/prev-x86_64-pc-linux-gnu/libstd
c++-v3/src/.libs -B/tmp/wpowell/spack-stage/spack-stage-u_7lic/gcc
-8.2.0/spack-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++
/.libs -I/tmp/wpowell/spack-stage/spack-stage-u_7lic/gcc-8.2.0/sp
ack-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-
linux-gnu -I/tmp/wpowell/spack-stage/spack-stage-u_7lic/gcc-8.2.0
/spack-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/include -I/sha
red/spack/var/spack/stage/gcc-8.2.0-arepu3ta2xtlboacnuxk3su2h3oqc3
lr/gcc-8.2.0/libstdc++-v3/libsupc++ -L/tmp/wpowell/spack-stage/spa
ck-stage-u_7lic/gcc-8.2.0/spack-build/prev-x86_64-pc-linux-gnu/lib
stdc++-v3/src/.libs -L/tmp/wpowell/spack-stage/spack-stage-u_7lic/
gcc-8.2.0/spack-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsup
c++/.libs -no-pie -g -O2 -gtoggle -DIN_GCC -fno-exceptions -
fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwr
ite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-vi
rtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlengt
h-strings -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc -o c
c1plus 
9723 cp/cp-lang.o c-family/stub-objc.o cp/call.o cp/class.o cp/c
onstexpr.o cp/constraint.o cp/cp-gimplify.o cp/cp-objcp-common.o c
p/cp-ubsan.o cp/cvt.o cp/cxx-pretty-print.o cp/decl.o cp/decl2.o c
p/dump.o cp/error.o cp/except.o cp/expr.o cp/friend.o cp/init.o cp
/lambda.o cp/lex.o cp/logic.o cp/mangle.o cp/method.o cp/name-look
up.o cp/optimize.o cp/parser.o cp/pt.o cp/ptree.o cp/repo.o cp/rtt
i.o cp/search.o cp/semantics.o cp/tree.o cp/typeck.o cp/typeck2.o
cp/vtable-class-hierarchy.o attribs.o incpath.o c-family/c-common.
o c-family/c-cppbuiltin.o c-family/c-dump.o c-family/c-format.o c-
family/c-gimplify.o c-family/c-indentation.o c-family/c-lex.o c-fa
mily/c-omp.o c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutpu
t.o c-family/c-pragma.o c-family/c-pretty-print.o c-family/c-seman
tics.o c-family/c-ada-spec.o c-family/c-ubsan.o c-family/known-hea
ders.o c-family/c-attribs.o c-family/c-warn.o c-family/c-spellchec
k.o i386-c.o glibc-c.o cc1plus-checksum.o libbackend.a main.o libc
ommon-target.a libcommon.a ../libcpp/libcpp.a ../libdecnumber/libd
ecnumber.a libcommon.a ../libcpp/libcpp.a ../libbacktrace/.libs/
libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumb
er.a -L/shared/spack/opt/spack/linux-rhel6-x86_64/gcc-4.8.2/isl-0
.18-xmai3obl46gqlvhruvm4hk7pxa32rbze/lib -lisl -L/shared/spack/opt
/spack/linux-rhel6-x86_64/gcc-4.8.2/gmp-6.1.2-srovmzcugjw3lzgjodl2
ecaw6zbsspx7/lib -L/shared/spack/opt/spack/linux-rhel6-x86_64/gcc-
4.8.2/mpfr-3.1.6-hlkt4pyx7novqzfr3frcb6im5stqjecu/lib -L/shared/sp
ack/opt/spack/linux-rhel6-x86_64/gcc-4.8.2/mpc-1.1.0-ifakhuo2jsdfw
f3hu7hvqj4lbt5tmw2p/lib -lmpc -lmpfr -lgmp -rdynamic -ldl -L/shar
ed/spack/opt/spack/linux-rhel6-x86_64/gcc-4.8.2/zlib-1.2.11-7z2qze
n7xxbgrxy5mijexrtcbtir6bwq/lib -lz
9724 echo | /tmp/wpowell/spack-stage/spack-stage-u_7lic/gcc-8.2.0/spack
-build/./gcc/xgcc -B/tmp/wpowell/spack-stage/spack-stage-u_7lic/gc
c-8.2.0/spack-build/./gcc/ -E -dM - | 
9725 sed -n -e 's/^#define ([^][a-zA-Z0-9])./\1/p' 
9726 -e 's/^#define (_[^A-Z][a-zA-Z0-9])./\1/p' | 
9727 sort -u > tmp-macro_list

9728 /tmp/wpowell/spack-stage/spack-stage-u_7lic/gcc-8.2.0/spack-build/
./gcc/cc1: error while loading shared libraries: libisl.so.15: can
not open shared object file: No such file or directory
9729 /bin/sh /shared/spack/var/spack/stage/gcc-8.2.0-arepu3ta2xtlboacnu
xk3su2h3oqc3lr/gcc-8.2.0/gcc/../move-if-change tmp-macro_list macr
o_list
9730 echo timestamp > s-macro_list
9731 rm -rf include-fixed; mkdir include-fixed
9732 chmod a+rx include-fixed
9733 if [ -d ../prev-gcc ]; then 
9734 cd ../prev-gcc && \

 ...

 9825       done
 9826    rm -f include-fixed/README
 9827    cp /shared/spack/var/spack/stage/gcc-8.2.0-arepu3ta2xtlboacnuxk3su
         2h3oqc3lr/gcc-8.2.0/gcc/../fixincludes/README-fixinc include-fixed
         /README
 9828    chmod a+r include-fixed/README
 9829    echo timestamp > stmp-int-hdrs
 9830    /tmp/wpowell/spack-stage/spack-stage-u_7lic/gcc-8.2.0/spack-build/
         ./gcc/xgcc -B/tmp/wpowell/spack-stage/spack-stage-u_7lic/gcc-8.2.0
         /spack-build/./gcc/ -xc -nostdinc /dev/null -S -o /dev/null -fself
         -test=/shared/spack/var/spack/stage/gcc-8.2.0-arepu3ta2xtlboacnuxk
         3su2h3oqc3lr/gcc-8.2.0/gcc/testsuite/selftests
9831 /tmp/wpowell/spack-stage/spack-stage-u_7lic/gcc-8.2.0/spack-build/
./gcc/cc1: error while loading shared libraries: libisl.so.15: can
not open shared object file: No such file or directory
9832 make[3]: *** [s-selftest-c] Error 1
9833 rm gfortran.pod gcc.pod
9834 make[3]: Leaving directory /tmp/wpowell/spack-stage/spack-stage-u _7lic/gcc-8.2.0/spack-build/gcc' 9835 make[2]: *** [all-stage2-gcc] Error 2 9836 make[2]: Leaving directory /tmp/wpowell/spack-stage/spack-stage-u
_7lic/gcc-8.2.0/spack-build'
9837 make[1]: *** [stage2-bubble] Error 2
9838 make[1]: Leaving directory `/tmp/wpowell/spack-stage/spack-stage-u
_7lic/gcc-8.2.0/spack-build'
9839 make: *** [all] Error 2

See build log for details:
/shared/spack/var/spack/stage/gcc-8.2.0-arepu3ta2xtlboacnuxk3su2h3oqc3lr/gcc-8.2.0/spack-build.out ```

@citibeth
Copy link
Member

citibeth commented May 21, 2019 via email

@ThrashinVictim
Copy link
Author

Still searching for a fix, but wanted to tell you what I tried.

Did yum install libisl-dev

Then was greeted with

No package libisl-dev available.

so now will look for a repo that has it since mine obviously doesnt.

@citibeth
Copy link
Member

citibeth commented May 21, 2019 via email

@ThrashinVictim
Copy link
Author

RHEL 6.4 on the login node I am using.

@citibeth
Copy link
Member

citibeth commented May 21, 2019 via email

@ThrashinVictim
Copy link
Author

ThrashinVictim commented May 21, 2019

I tried Yum install libisl-devel.
But still said no package.
I am trying an older version of GCC. Hoping this will fix the problem.

@ThrashinVictim
Copy link
Author

Ok did
spack install gcc@4.8.5

> Error: ProcessError: Command exited with status 2:
    'make' '-j6'

7 errors found in build log:
     3124    echo TARGET_SYSTEM_ROOT = '' >> tmp-libgcc.mvars
     3125    mv tmp-libgcc.mvars libgcc.mvars
     3126    echo | /tmp/wpowell/spack-stage/spack-stage-0lfUqN/gcc-4.8.5/spack
             -build/./gcc/xgcc -B/tmp/wpowell/spack-stage/spack-stage-0lfUqN/gc
             c-4.8.5/spack-build/./gcc/ -E -dM - | \
     3127         sed -n -e 's/^#define \([^_][a-zA-Z0-9_]*\).*/\1/p' \
     3128                -e 's/^#define \(_[^_A-Z][a-zA-Z0-9_]*\).*/\1/p' | \
     3129         sort -u > tmp-macro_list
  >> 3130    xgcc: error trying to exec 'cc1': execvp: No such file or director
             y
     3131    /bin/sh /shared/spack/var/spack/stage/gcc-4.8.5-wzgu3xnx34gkscwnv2
             ukf2iebdxhzmst/gcc-4.8.5/gcc/../move-if-change tmp-macro_list macr
             o_list
     3132    echo timestamp > s-macro_list
     3133    if /tmp/wpowell/spack-stage/spack-stage-0lfUqN/gcc-4.8.5/spack-bui
             ld/./gcc/xgcc -B/tmp/wpowell/spack-stage/spack-stage-0lfUqN/gcc-4.
             8.5/spack-build/./gcc/ -print-sysroot-headers-suffix > /dev/null 2
             >&1; then \
     3134         set -e; for ml in `/tmp/wpowell/spack-stage/spack-stage-0lfUqN/
             gcc-4.8.5/spack-build/./gcc/xgcc -B/tmp/wpowell/spack-stage/spack-
             stage-0lfUqN/gcc-4.8.5/spack-build/./gcc/ -print-multi-lib`; do \
     3135           multi_dir=`echo ${ml} | sed -e 's/;.*$//'`; \
     3136           flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \

     ...

     8260    echo TARGET_SYSTEM_ROOT = '' >> tmp-libgcc.mvars
     8261    mv tmp-libgcc.mvars libgcc.mvars
     8262    echo | /tmp/wpowell/spack-stage/spack-stage-0lfUqN/gcc-4.8.5/spack
             -build/./gcc/xgcc -B/tmp/wpowell/spack-stage/spack-stage-0lfUqN/gc
             c-4.8.5/spack-build/./gcc/ -E -dM - | \
     8263         sed -n -e 's/^#define \([^_][a-zA-Z0-9_]*\).*/\1/p' \
     8264                -e 's/^#define \(_[^_A-Z][a-zA-Z0-9_]*\).*/\1/p' | \
     8265         sort -u > tmp-macro_list
  >> 8266    xgcc: error trying to exec 'cc1': execvp: No such file or director
             y
     8267    /bin/sh /shared/spack/var/spack/stage/gcc-4.8.5-wzgu3xnx34gkscwnv2
             ukf2iebdxhzmst/gcc-4.8.5/gcc/../move-if-change tmp-macro_list macr
             o_list
     8268    echo timestamp > s-macro_list
     8269    if /tmp/wpowell/spack-stage/spack-stage-0lfUqN/gcc-4.8.5/spack-bui
             ld/./gcc/xgcc -B/tmp/wpowell/spack-stage/spack-stage-0lfUqN/gcc-4.
             8.5/spack-build/./gcc/ -print-sysroot-headers-suffix > /dev/null 2
             >&1; then \
     8270         set -e; for ml in `/tmp/wpowell/spack-stage/spack-stage-0lfUqN/
             gcc-4.8.5/spack-build/./gcc/xgcc -B/tmp/wpowell/spack-stage/spack-
             stage-0lfUqN/gcc-4.8.5/spack-build/./gcc/ -print-multi-lib`; do \
     8271           multi_dir=`echo ${ml} | sed -e 's/;.*$//'`; \
     8272           flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \

     ...

     8416    checking for x86_64-unknown-linux-gnu-lipo... lipo
     8417    checking for x86_64-unknown-linux-gnu-nm... /tmp/wpowell/spack-sta
             ge/spack-stage-0lfUqN/gcc-4.8.5/spack-build/./gcc/nm
     8418    checking for x86_64-unknown-linux-gnu-ranlib... ranlib
     8419    checking for x86_64-unknown-linux-gnu-strip... strip
     8420    checking whether ln -s works... yes
     8421    checking for x86_64-unknown-linux-gnu-gcc... /tmp/wpowell/spack-st
             age/spack-stage-0lfUqN/gcc-4.8.5/spack-build/./gcc/xgcc -B/tmp/wpo
             well/spack-stage/spack-stage-0lfUqN/gcc-4.8.5/spack-build/./gcc/ -
             B/shared/spack/opt/spack/linux-rhel6-x86_64/gcc-4.8.2/gcc-4.8.5-wz
             gu3xnx34gkscwnv2ukf2iebdxhzmst/x86_64-unknown-linux-gnu/bin/ -B/sh
             ared/spack/opt/spack/linux-rhel6-x86_64/gcc-4.8.2/gcc-4.8.5-wzgu3x
             nx34gkscwnv2ukf2iebdxhzmst/x86_64-unknown-linux-gnu/lib/ -isystem
             /shared/spack/opt/spack/linux-rhel6-x86_64/gcc-4.8.2/gcc-4.8.5-wzg
             u3xnx34gkscwnv2ukf2iebdxhzmst/x86_64-unknown-linux-gnu/include -is
             ystem /shared/spack/opt/spack/linux-rhel6-x86_64/gcc-4.8.2/gcc-4.8
             .5-wzgu3xnx34gkscwnv2ukf2iebdxhzmst/x86_64-unknown-linux-gnu/sys-i
             nclude
  >> 8422    checking for suffix of object files... configure: error: in `/tmp/
             wpowell/spack-stage/spack-stage-0lfUqN/gcc-4.8.5/spack-build/x86_6
             4-unknown-linux-gnu/libgcc':
  >> 8423    configure: error: cannot compute suffix of object files: cannot co
             mpile
     8424    See `config.log' for more details.
  >> 8425    make[2]: *** [configure-stage2-target-libgcc] Error 1
     8426    make[2]: Leaving directory `/tmp/wpowell/spack-stage/spack-stage-0
             lfUqN/gcc-4.8.5/spack-build'
  >> 8427    make[1]: *** [stage2-bubble] Error 2
     8428    make[1]: Leaving directory `/tmp/wpowell/spack-stage/spack-stage-0
             lfUqN/gcc-4.8.5/spack-build'
  >> 8429    make: *** [all] Error 2

See build log for details:
  /shared/spack/var/spack/stage/gcc-4.8.5-wzgu3xnx34gkscwnv2ukf2iebdxhzmst/gcc-4.8.5/spack-build.out

@scheibelp
Copy link
Member

xgcc: error trying to exec 'cc1': execvp: No such file or directory

I get the impression from https://stackoverflow.com/questions/11912878/gcc-error-gcc-error-trying-to-exec-cc1-execvp-no-such-file-or-directory that the system compiler you are using may need some additional utilities installed to compile a new version of GCC- it is suggesting

yum install gcc-c++

@scheibelp
Copy link
Member

@liamrpowell I haven't seen a response to #11396 (comment) for a few months so I am going to close this. If you can still replicate the issue feel free to reopen the bug (in which case could you try the suggestion at #11396 (comment)?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants