CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   SU2 Installation (http://www.cfd-online.com/Forums/su2-installation/)
-   -   Paths confusion in python scripts (http://www.cfd-online.com/Forums/su2-installation/111516-paths-confusion-python-scripts.html)

praveen January 9, 2013 02:55

Paths confusion in python scripts
 
Hi
The new configure and installation is an improvement. I see that it copies all executables to the prefix/bin directory including the python scripts.

However all the python scripts are using old style paths, e.g., in parallel_computation.py you have

run_SU2_DDC = "mpirun -np 1 $SU2_HOME/SU2Py/SU2_DDC %s" % (Config_DDC_filename)

etc.

These paths dont even contain the executables. Moreover it is never explained that SU2_HOME variable has to be set or maybe it is somewhere deep inside the docs. This can be very confusing.

e3lb89cz January 9, 2013 10:11

I found the same problem. The path settings in Python scripts are not consistent, e.g. su2_basedir in different scripts has different settings.

copeland January 9, 2013 19:29

First, thanks for your interest in SU2, we appreciate your participation in finding and reporting bugs like these.

As you can imagine, things are moving quickly in the development of the code and the release of autoconf installation tools is a big step toward having a standard and robust method of installation on different platforms. This capability offers more flexibility in the installation of the software than our previous python-based installation script allowed and is the cause of the path confusion in the python scripts.

This is something we should have caught in quality control before the release and apologize for the confusion. The development team will have a fix for this problem by the end of the week to unify the compilation via autoconf and the build_SU2.py python script and resolve the path conflicts in the python scripts.

The issue should only affect those users that are using the python scripts to orchestrate the more advanced features of the solver. There are two solutions to the problem that I'd suggest. The first (and easiest) is to simply build the source code using the build_SU2.py script in the $SU2_HOME/SU2Py directory. This will place the executables in the proper locations and everything should work out of the box. For example:

>> cd $SU2_HOME/SU2Py
>> ./build_SU2.py -o redhat -p

Please note that this a short term solution as we are in the process of moving away from the python build script. The other option is to build with autoconf, but temporarily hard-code of the full path in the python scripts to the prefix path specified during the configure step of the build. For example, in the parallel_computation.py:

WAS:
>> line 96
# compose function call format and inputs
run_SU2_DDC = "mpirun -np 1 $SU2_HOME/SU2Py/SU2_DDC %s" % (Config_DDC_filename)
run_SU2_CFD = "mpirun -np %s $SU2_HOME/SU2Py/SU2_CFD %s" % (partitions, Config_CFD_filename)
if unsteady_simulation:
run_merge_solution = "$SU2_HOME/SU2Py/merge_unsteady.py -p %s -f %s -b %s -e %s" % (partitions, Config_CFD_filename, 0, nExtIter)
else:
run_merge_solution = "$SU2_HOME/SU2Py/merge_solution.py -p %s -f %s -o %s" % (partitions, Config_CFD_filename, output)

IS:
>> line 96
# compose function call format and inputs
run_SU2_DDC = "mpirun -np 1 /YOUR_CONFIGURE_PREFIX/bin/SU2_DDC %s" % (Config_DDC_filename)
run_SU2_CFD = "mpirun -np %s /YOUR_CONFIGURE_PREFIX/bin/SU2_CFD %s" % (partitions, Config_CFD_filename)
if unsteady_simulation:
run_merge_solution = "/YOUR_CONFIGURE_PREFIX/bin/merge_unsteady.py -p %s -f %s -b %s -e %s" % (partitions, Config_CFD_filename, 0, nExtIter)
else:
run_merge_solution = "/YOUR_CONFIGURE_PREFIX/bin/merge_solution.py -p %s -f %s -o %s" % (partitions, Config_CFD_filename, output)


Just to reiterate, we'll have a real solution to the problem by the end of the week. Please stay tuned here on the message boards, and on the susquared-users mailing list. Thanks.

rktchip January 11, 2013 23:32

We've updated the source code, linux binaries and macosx binaries with a fix for the python paths. You'll need to set an environment variable called $SU2_RUN, which points to the directory with the SU2 binaries and python scripts. You'll also need to add this directory to the $PATH. $SU2_HOME will remain the environment variable that points to the source trunk.

More information can be found in the updated installation instructions.

Thanks again for pointing this out, and let us know if you find anything else!

praveen January 12, 2013 03:33

Untaring the source on mac gives this message


Code:

x SU2v2.0/autom4te.cache/output.0
x SU2v2.0/autom4te.cache/output.1
x SU2v2.0/autom4te.cache/requests
tar: copyfile unpack (SU2v2.0/COMPLETE~) failed: File exists

though this seems to be harmless. I did not see this message on Linux.

configure gives wrong info about setting SU2_HOME, for example

Code:

export SU2_RUN="/tmp/SU2v2.0/bin"
export SU2_HOME="/home/twl26/SU2_svn/post/SU2v2.0/trunk"
export PATH=$PATH:$SU2_RUN


rktchip January 12, 2013 16:42

Thanks a lot! Made some fixes and the configure output should be correct now. We havn't been able to reproduce the mac untar warning, but re-tarred it just in case.

Were you able to run the python scripts without trouble once you set the environment variables?

rktchip January 15, 2013 11:44

FYI - Just fixed the tar un-archiving error.
-Trent

praveen January 17, 2013 03:34

The python scripts are working fine now when I ran a shape optimization problem.

cfdbooks2008 January 20, 2013 10:02

The Linux version and SciPy version?
 
Quote:

Originally Posted by praveen (Post 402379)
The python scripts are working fine now when I ran a shape optimization problem.

Hi,Praveen
Could you tell me the running environment (Linux version and SciPy version)? I have installed the SU2 on Redhat Enterprise workstation 6.3 successfully , but failed to install SciPy(version 0.11). Thanks in advance.

mripepi March 3, 2013 07:51

Hi all,

I found that in SU2 version 2.0, the path for the METIS package in build_SU2.py refers to the directory su2_home + '/metis-4.0.3'.
I suggest to add a function in build_SU2.py for handling METIS changes to the makefile, as already done for CGNS package.
So you can give an option during the python compiling in order to be able in using the preferred METIS library and include path directories.


Matteo


All times are GMT -4. The time now is 00:06.