gmpe-smtk

367 views
Skip to first unread message

gonzalo antonio fernandez marañon

unread,
Sep 28, 2015, 4:17:11 PM9/28/15
to OpenQuake Users
Dear Group.

Congratulations for all the openquake engine, I am Gonzalo Fernandez  from Bolivia, I am helping in the Topic 6 SARA project GMPE, to fulfill this task I tried to clone the repository gmpe-smtk from github unfortunately I could not do it, I will briefly tell you what I did.

1.- I have already created a virtual environment called "sara" within the SmartGit.
2.- I have installed Anaconda under windows 7- 32bits.
3.- When I type sara within the cmd anaconda it activates without problems
4.- I have installed under the virtual env the following packages :
  • Numpy (1.6.1 or later) (installed with oq-hazardlib)
  • Scipy (0.11.0 or later) (installed with oq-hazardlib)
  • Shapely (installed with oq-hazardlib)
  • Matplotlib (1.3.x or later)
  • h5py (2.2.0)
       All of them without problems,.
5.- I cloned successfully the oq-hazard package with the command

git clone https://github.com/gem/oq-hazardlib.git

6. I have installed successfully the package mingw for anaconda under windows without problems.

7.- While I have tried to compile with :

python setup.py install build --compiler=mingw32

I have the following error:

collect2.exe: ID returned 1 exit status (attached the figure), I also show the log message:

-------------------------------------------------------------------------------------------------------------------------------------
C:\Anaconda\envs\sara\Lib\site-packages\numpy\core\include/numpy/npy_1_7_depreca
ted_api.h:12:9: note: #pragma message: C:\Anaconda\envs\sara\Lib\site-packages\n
umpy\core\include/numpy/npy_1_7_deprecated_api.h(12) : Warning Msg: Using deprec
ated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSIO
N
writing build\temp.win32-2.7\Release\speedups\_geodetic_speedups.def
C:\Anaconda\envs\sara\Scripts\gcc.bat -shared -s build\temp.win32-2.7\Release\sp
eedups\geodeticmodule.o build\temp.win32-2.7\Release\speedups\_geodetic_speedups
.def -LC:\Anaconda\envs\sara\libs -LC:\Anaconda\envs\sara\PCbuild -lpython27 -lm
svcr90 -o build\lib.win32-2.7\openquake\hazardlib\geo\_geodetic_speedups.pyd
build\temp.win32-2.7\Release\speedups\geodeticmodule.o:geodeticmodule.c:(.text+0
x60b): undefined reference to `__imp__PyCObject_Type'
build\temp.win32-2.7\Release\speedups\geodeticmodule.o:geodeticmodule.c:(.text+0
x615): undefined reference to `__imp__PyExc_RuntimeError'
build\temp.win32-2.7\Release\speedups\geodeticmodule.o:geodeticmodule.c:(.text+0
x632): undefined reference to `__imp__PyExc_ImportError'
build\temp.win32-2.7\Release\speedups\geodeticmodule.o:geodeticmodule.c:(.text+0
x6db): undefined reference to `__imp__PyExc_RuntimeError'
build\temp.win32-2.7\Release\speedups\geodeticmodule.o:geodeticmodule.c:(.text+0
x6ec): undefined reference to `__imp__PyExc_ImportError'
build\temp.win32-2.7\Release\speedups\geodeticmodule.o:geodeticmodule.c:(.text+0
x727): undefined reference to `__imp__PyExc_RuntimeError'
build\temp.win32-2.7\Release\speedups\geodeticmodule.o:geodeticmodule.c:(.text+0
x738): undefined reference to `__imp__PyExc_ImportError'
build\temp.win32-2.7\Release\speedups\geodeticmodule.o:geodeticmodule.c:(.text+0
x749): undefined reference to `__imp__PyExc_ImportError'
build\temp.win32-2.7\Release\speedups\geodeticmodule.o:geodeticmodule.c:(.text+0
x784): undefined reference to `__imp__PyExc_AttributeError'
build\temp.win32-2.7\Release\speedups\geodeticmodule.o:geodeticmodule.c:(.text+0
x79f): undefined reference to `__imp__PyExc_ImportError'
build\temp.win32-2.7\Release\speedups\geodeticmodule.o:geodeticmodule.c:(.text+0
x7be): undefined reference to `__imp__PyExc_RuntimeError'
collect2.exe: error: ld returned 1 exit status
error: command 'C:\\Anaconda\\envs\\sara\\Scripts\\gcc.bat' failed with exit sta
tus 1
-----------------------------------------------------------------------------------------------------------------------------
I have the following path "C:\\Anaconda\\envs\\sara\\Scripts\\" and the gcc.bat also is present in the specified folder.

I will be so grateful for your commentaries and suggestions.
 
Thank you for your time spent reading it.

Best Regards.
Gonzalo F
Bolivia
A_oq_compile error.jpg

Michele Simionato

unread,
Sep 29, 2015, 5:58:00 AM9/29/15
to OpenQuake Users
I don't remember this kind of error and today our sysadmin is out of office. However remember that:

1) the speedups are optional, so hazardlib will work even without them, even if it will be slower
2) you can still use one of our preconfigured Xubuntu virtual machines

Windows is officially NOT supported, but we have unofficial installation instructions for Python XY, not Anaconda.
We got this working on a clean system, but you are on your own when it comes to Windows:

Install git: (download the 32 bit version, the exe file is provided in the course folder) https://github.com/git-for-windows/git/releases/download/v2.5.3.windows.1/Git-2.5.3-32-bit.exe
(the exe file is provided in the course folder)
(please note that PythonXY 2.7.10 does not work for the speedups compile)
Install PythonXY: make sure you have selected also 
Cython
GDAL
Download and install: (the exe files are provided in the course folder)
       5.   Download the oq-hazardlib 
5.1 open git-bash
5.2 type:  cd D:    (to go to the D drive)
5.3 type:  mkdir Openquake (to create new directory called “Openquake”)
5.4 type:  git clone --depth=1 https://github.com/gem/oq-hazardlib.git 
 (get a copy of an existing Git repository, oq-hazardlib, to your local machine)
       6.   Download the oq-risklib 
6.1 type:  git clone --depth=1 https://github.com/gem/oq-risklib.git 
       7.   Download the Hazard Modeller's Toolkit (hmtk)
       8.   Download the GMPE Strong Motion Modeller's Toolkit (gmpe-smtk)
8.1 type:  git clone --depth=1 https://github.com/GEMScienceTools/gmpe-smtk.git
       9.   Download the Catalogue Toolkit (catalogue_tool)
      10. Install oq-risklib 
10.1 type: cd oq-risklib    (go to the oq-risklib folder)
10.2 tyep: python setup.py build --compiler=mingw32
10.3 type: python setup.py install
      11. Install oq-hazardlib, hmtk, gmpe-smtk, catalogue_toolkit (by adding to pythonpath)
11.1 Open Control Panel -> System -> Advanced System Settings -> Environment Variables
11.2 [pythonpath already exists], insert the below statement to the existing pythonpath:
     D:\Openquake\oq-hazardlib\;D:\Openquake\hmtk\;D:\Openquake\gmpe-smtk\;D:\Openquake\catalogue_toolkit\;

       [pythonpath does not exist], first create a new variable, called pythonpath and then
insert the below statement to the existing pythonpath:
   D:\Openquake\oq-hazardlib\;D:\Openquake\hmtk\;D:\Openquake\gmpe-smtk\;D:\Openquake\catalogue_toolkit\;

gonzalo antonio fernandez marañon

unread,
Sep 29, 2015, 3:19:53 PM9/29/15
to openqua...@googlegroups.com
Dear Michele.

Thank you for your time, I will do what you told me and I will let you know.

Best regards.

Gonzalo
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "OpenQuake Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/openquake-users/EK1fefyko3A/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> openquake-use...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Daniele Viganò

unread,
Sep 29, 2015, 5:53:34 PM9/29/15
to OpenQuake Users
Dear Gonzalo,

I never seen that specific error, but it's similar to an error that we are experiencing with Python(x,y) 2.7.10. These errors looks more bugs in the Python distributions (Anaconda and XY) more than an issue with the hazardlib speedups since they come from the linker and they are about missing symbols.

In any case, we know it shoudl work using Python(x,y) 2.7.9, so you have two options as Michele said:

  1. Use oq-hazardlib without the speedups while we have a look to these linker issues
  2. Use Python(x,y) 2.7.9

The instructions sent by Michele are a preliminary drafts and they contain some small errors/imprecisions (i.e. the link to Python 2.7.9 is now broken, you should use the Kent mirror instead). I will publish on our wiki the fixed setup as soon as possible.


Cheers,

Daniele

gonzalo antonio fernandez marañon

unread,
Sep 29, 2015, 7:06:02 PM9/29/15
to OpenQuake Users

Dear Daniele

Thank you for the information and time spent on this issue.

I noticed that the ipython 2.7;9 link is out of service, thanks for the mirror information
If you do not mind i have a question:

1. How can i isolate the speedup to compile under Windows? I know Windows has no support about it and all the oficial repo are under Linux, for that reason thank you for your effors

Best regards

Gonzalo


--

Daniele Viganò

unread,
Sep 30, 2015, 1:31:18 AM9/30/15
to openqua...@googlegroups.com
Dear Gonzalo,



On 30/09/15 01:05, gonzalo antonio fernandez marañon wrote:

I noticed that the ipython 2.7;9 link is out of service, thanks for the mirror information

yes, they removed the 2.7.9 version three days ago (d'oh!). Now you must use the mirror provided by the University of Kent:

http://www.mirrorservice.org/sites/pythonxy.com/Python(x,y)-2.7.9.0.exe


If you do not mind i have a question:

1. How can i isolate the speedup to compile under Windows? I know Windows has no support about it and all the oficial repo are under Linux, for that reason thank you for your effors

Using python xy 2.7.9 should be possible; roughly you have to:

Install python xy 2.7.9 from http://www.mirrorservice.org/sites/pythonxy.com/Python(x,y)-2.7.9.0.exe, make sure you have checked Cython and GDAL during the installation.

Install also shapely, mingw (which includes GCC) and basemap (is needed by some OQ tools):
Now you should be able to run, from the oq-hazardlib repo:

python setup build --compiler=mingw32
python setup install

Then you have to set the PYTHONPATH as usual.

Cheers,
Daniele

--
DANIELE VIGANÒ | System Administrator | Skype dennyv85 | +39 0382 5169882
GLOBAL EARTHQUAKE MODEL | working together to assess risk

gonzalo antonio fernandez marañon

unread,
Sep 30, 2015, 6:43:40 PM9/30/15
to OpenQuake Users

Dear Daniele

Thank you for the help i will keep trying

Best regards
Gonzalo

--
Reply all
Reply to author
Forward
0 new messages