Comments (11)
Hi, that's because for some reason Anaconda thinks it's okay to append .cpython-37m-x86_64-linux-gnu
to the end of the compiled extension (regular python does not do this).
As a quick fix you can rename _pycutestitf.cpython-37m-x86_64-linux-gnu.so
to _pycutestitf.so
while we investigate the root cause of this and find a way to resolve the issue.
@lindonroberts: any thoughts on this?
from pycutest.
You mean doing something like
$PYCUTEST_CACHE/pycutest_cache_holder/HS110/_pycutestitf.cpython-37m-x86_64-linux-gnu.so $PYCUTEST_CACHE/pycutest_cache_holder/HS110/_pycutestitf.so
?
I tried this but it didn't work. Also, sometimes I get a segfault instead of the data file not found error.
from pycutest.
So that's what I meant, but that doesn't seem to be the issue after all. It turns out that I can run PyCUTEst fine on a fresh install of Anaconda (specifically using the latest Minconda installer):
Python 3.7.1 (default, Dec 14 2018, 19:28:38)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pycutest
/home/fowkes/miniconda3/lib/python3.7/site-packages/pycutest/__init__.py:28: RuntimeWarning: the PYCUTEST_CACHE environment variable is not set; current folder will be used for caching.
warnings.warn("the PYCUTEST_CACHE environment variable is not set; current folder will be used for caching.", RuntimeWarning)
>>> p = pycutest.import_problem('ROSENBR')
>>> p.x0
array([-1.2, 1. ])
>>>
and I also have the same as you in the ~/pycutest_cache_holder/ROSENBR
directory:
AUTOMAT.d build cutestitf.c ELFUN.f ELFUN.o EXTER.f EXTER.o GROUP.f GROUP.o __init__.py OUTSDIF.d __pycache__ PyCUTEst_automatic_test_function_interface_builder-1.0-py3.7.egg-info _pycutestitf.cpython-37m-x86_64-linux-gnu.so RANGE.f RANGE.o setup.py
Could you try running without setting PYCUTEST_CACHE
in your .bashrc
? I'm wondering if it's the cache folder handling that's causing the issue here.
from pycutest.
I tried, but no luck:
Python 3.7.1 (default, Dec 14 2018, 19:28:38)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.2.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import pycutest
/opt/continuum/anaconda3/lib/python3.7/site-packages/pycutest/__init__.py:28: RuntimeWarning: the PYCUTEST_CACHE environment variable is not set; current folder will be used for caching.
warnings.warn("the PYCUTEST_CACHE environment variable is not set; current folder will be used for caching.", RuntimeWarning)
In [2]: p = pycutest.import_problem("HS110")
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
<ipython-input-2-82d3da318ed4> in <module>
----> 1 p = pycutest.import_problem("HS110")
/opt/continuum/anaconda3/lib/python3.7/site-packages/pycutest/build_interface.py in import_problem(problemName, destination, sifParams, sifOptions, efirst, lfirst, nvfirst, quiet, drop_fixed_variables)
334 problemDir = destination
335 # Import the module CACHE_SUBFOLDER.problemDir, and return a wrapper
--> 336 return CUTEstProblem(__import__('%s.%s' % (CACHE_SUBFOLDER, problemDir), globals(), locals(), [str(problemDir)]),
337 drop_fixed_variables=drop_fixed_variables)
338
~/documentos/pesquisa/splitLP/pycutest_cache_holder/HS110/__init__.py in <module>
61
62 # Get problem dimension
---> 63 (n, m)=_pycutestitf._dims()
64
65 # Set up the problem and get basic information
Exception: Failed to open data file
In [3]:
from pycutest.
Ok let's try debugging the exception: "Failed to open data file" means that OUTSDIF.d
cannot be found or read, so the first thing to check is that __init.py__
is looking for it in the correct place. Could you edit HS110/__init.py__
after line 46 to print out _directory
and _module
?
You should get something like ~/pycutest_cache_holder/HS110
for _directory
and _pycutestitf.cpython-37m-x86_64-linux-gnu.so
for _module
.
from pycutest.
Hi, just to confirm, have you confirmed the underlying CUTEst install is working correctly? You can test with (from https://github.com/ralna/CUTEst/blob/master/doc/README):
cd $SIFDECODE/src ; make -f $SIFDECODE/makefiles/$MYARCH test
cd $CUTEST/src ; make -f $CUTEST/makefiles/$MYARCH test
from pycutest.
Here goes the output with the prints. I have also tried to test CUTEst but it says that the test target is not in the Makefile. I even tried to recompile it. It works with the Algencan interface, so sifdecoder is working and the CUTEst library should also be working. The output of the _module and _directory look OK.
ython 3.7.1 (default, Dec 14 2018, 19:28:38)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.2.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import pycutest
/opt/continuum/anaconda3/lib/python3.7/site-packages/pycutest/__init__.py:28: RuntimeWarning: the PYCUTEST_CACHE environment variable is not set; current folder will be used for caching.
warnings.warn("the PYCUTEST_CACHE environment variable is not set; current folder will be used for caching.", RuntimeWarning)
In [2]: p = pycutest.import_problem("HS110")
******************** /home/pjssilva/documentos/pesquisa/splitLP/pycutest_cache_holder/HS110
******************** _pycutestitf.cpython-37m-x86_64-linux-gnu.so
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
<ipython-input-2-82d3da318ed4> in <module>
----> 1 p = pycutest.import_problem("HS110")
/opt/continuum/anaconda3/lib/python3.7/site-packages/pycutest/build_interface.py in import_problem(problemName, destination, sifParams, sifOptions, efirst, lfirst, nvfirst, quiet, drop_fixed_variables)
334 problemDir = destination
335 # Import the module CACHE_SUBFOLDER.problemDir, and return a wrapper
--> 336 return CUTEstProblem(__import__('%s.%s' % (CACHE_SUBFOLDER, problemDir), globals(), locals(), [str(problemDir)]),
337 drop_fixed_variables=drop_fixed_variables)
338
~/documentos/pesquisa/splitLP/pycutest_cache_holder/HS110/__init__.py in <module>
63
64 # Get problem dimension
---> 65 (n, m)=_pycutestitf._dims()
66
67 # Set up the problem and get basic information
Exception: Failed to open data file
In [3]:
Do you really want to exit ([y]/n)? y
pjssilva@trinity:~/documentos/pesquisa/splitLP$ ls /home/pjssilva/documentos/pesquisa/splitLP/pycutest_cache_holder/HS110
AUTOMAT.d build cutestitf.c ELFUN.f ELFUN.o EXTER.f EXTER.o GROUP.f GROUP.o __init__.py OUTSDIF.d __pycache__ PyCUTEst_automatic_test_function_interface_builder-1.0-py3.7.egg-info _pycutestitf.cpython-37m-x86_64-linux-gnu.so RANGE.f RANGE.o setup.py
from pycutest.
Looks like a Fortran issue to me then: the "Failed to open data file" exception is thrown on line 115 of c_interface.py
and indicates that the FORTRAN_open
call on line 113 is failing for some reason. This could be due to incompatible Fortran compilers being used for CUTEst and PyCUTEst. At the moment we only support gfortran for PyCUTEst, are you using a different Fortran compiler for CUTEst itself?
from pycutest.
I used gfortran 8.2 to compile CUTEst. Maybe some incompatibility between this gfortran version and the one Anaconda used? I will try today to install it using Ubuntu's Python and see how it goes.
from pycutest.
Yes I suspect that's the issue: Anaconda uses gfortran 7.3 (as you can see from the first line of your initial code listing).
from pycutest.
Did that fix your issue? I have updated the README with a note to ensure that PyCUTEst and CUTEst use the same version of gfortran.
from pycutest.
Related Issues (20)
- path problem in mac HOT 1
- An option or function to get all the problems compiled and saved, so that they do not need to be compiled on the fly HOT 8
- I want to specify the dimension of the unconstrained optimization problem, how do I set that? HOT 8
- PyCUTEst v1.5.0 breaks existing cached problems HOT 12
- module 'pycutest_cache_holder.X' has no attribute 'setup' HOT 1
- error when Installing on Linux HOT 10
- Better handling of incompatible Fortran compilers
- System state isn't restored after loading failure (`FileNotFoundError`) HOT 2
- How to find problems with equality constraints only? HOT 5
- Support for ARM-based Mac HOT 2
- import_problem HOT 5
- Release of memory HOT 6
- Facing error when attempting to run the given example HOT 2
- Conversion of an array with ndim > 0 to a scalar is deprecated and will error in future
- Pycutest with Knitro solver HOT 1
- Add new CUTEst routines for the John function HOT 2
- Add missing sparse routines (sobj, sgrad)
- Compilation in parallel on macOS does not work HOT 5
- Setuptools not installed by default HOT 3
- Switch to `pyproject.toml`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycutest.