Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LAMBERT Jean-charles
uns_projects
Commits
0becd514
Commit
0becd514
authored
Aug 07, 2018
by
LAMBERT Jean-charles
Browse files
update to compile against new unsio install
parent
0aa4aa10
Changes
4
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
0becd514
...
...
@@ -113,11 +113,11 @@ include_directories (${EXTRA_INCLUDES})
if
(
FALCON_INSTALLED
)
include_directories
(
${
DEHNEN
}
/falcON/utils/inc
${
DEHNEN
}
/falcON/inc
)
endif
()
include_directories
(
${
UNSIOPATH
}
/lib
${
UNSIOPATH
}
/inc
${
UNSIOPATH
}
/inc
/uns
)
include_directories
(
${
UNSIOPATH
}
/lib
${
UNSIOPATH
}
/inc
lude
${
UNSIOPATH
}
/inc
lude/uns $ENV{NEMO}/inc
)
include_directories
(
/usr/include/malloc
)
# Make sure the linker can find the Hello library once it is built.
link_directories
(
${
UNSIOPATH
}
/lib
${
DEHNEN
}
/falcON/lib
${
DEHNEN
}
/utils/lib $ENV{PGPLOT_DIR}
${
G2C_DIR
}
${
PROJECT_BINARY_DIR
}
/lib /usr/lib64 /usr/X11/lib
${
FC_GFORT_PATH
}
${
FC_G77_PATH
}
${
EXTRA_LINK_DIRS
}
)
link_directories
(
${
UNSIOPATH
}
/lib
64
${
DEHNEN
}
/falcON/lib
${
DEHNEN
}
/utils/lib $ENV{PGPLOT_DIR}
${
G2C_DIR
}
${
PROJECT_BINARY_DIR
}
/lib /usr/lib64 /usr/X11/lib
${
FC_GFORT_PATH
}
${
FC_G77_PATH
}
${
EXTRA_LINK_DIRS
}
)
# ----------------------------------------------------------
# Install SETUP
...
...
@@ -125,7 +125,9 @@ link_directories ( ${UNSIOPATH}/lib ${DEHNEN}/falcON/lib ${DEHNEN}/utils/lib $EN
mark_as_advanced
(
CMAKE_INSTALL_PREFIX
)
set
(
CMAKE_INSTALL_PREFIX
${
UNSIOPATH
}
)
if
(
NOT CMAKE_INSTALL_PREFIX
)
set
(
CMAKE_INSTALL_PREFIX
${
UNSIOPATH
}
)
endif
()
MESSAGE
(
STATUS
"--------> CMAKE_INSTALL_PREFIX ="
${
CMAKE_INSTALL_PREFIX
}
)
if
(
OSX
)
...
...
@@ -170,7 +172,7 @@ FOREACH(exe_cpp ${execpp_sources})
#
if
(
NEMO_INSTALLED
)
target_link_libraries
(
${
exe
}
JCLutils JCLprojects cpgplot pgplot.a
${
FC_GFORT_LIB
}
${
FC_G77_LIB
}
CCfits cfitsio X11 nemo unsio WDutils falcON gomp
${
LIBBOOST
}
pthread dl
)
target_link_libraries
(
${
exe
}
JCLutils JCLprojects cpgplot pgplot.a
${
FC_GFORT_LIB
}
${
FC_G77_LIB
}
CCfits cfitsio X11 nemo unsio WDutils falcON gomp
${
LIBBOOST
}
pthread dl
)
else
()
target_link_libraries
(
${
exe
}
JCLutils JCLprojects
${
FC_GFORT_LIB
}
${
FC_G77_LIB
}
CCfits cfitsio nemo unsio gomp
${
LIBBOOST
}
dl
)
endif
()
...
...
@@ -195,8 +197,8 @@ FOREACH(exe_cpp ${execpp_sources})
get_filename_component
(
exe
${
exe_cpp
}
NAME_WE
)
#INSTALL(PROGRAMS ${PROJECT_BINARY_DIR}/bin/${exe} DESTINATION bin)
ENDFOREACH
(
exe_cpp
${
execpp_sources
}
)
INSTALL
(
FILES
${
PROJECT_BINARY_DIR
}
/lib/libJCLutils.
${
SOEXT
}
DESTINATION lib
)
INSTALL
(
FILES
${
PROJECT_BINARY_DIR
}
/lib/libJCLprojects.
${
SOEXT
}
DESTINATION lib
)
INSTALL
(
FILES
${
PROJECT_BINARY_DIR
}
/lib/libJCLutils.
${
SOEXT
}
DESTINATION lib
64
)
INSTALL
(
FILES
${
PROJECT_BINARY_DIR
}
/lib/libJCLprojects.
${
SOEXT
}
DESTINATION lib
64
)
INSTALL
(
FILES
${
PROJECT_SOURCE_DIR
}
/man/uns_2dplot.1 DESTINATION man/man1
)
INSTALL
(
FILES
${
PROJECT_SOURCE_DIR
}
/man/uns_stack.1 DESTINATION man/man1
)
INSTALL
(
FILES
${
PROJECT_SOURCE_DIR
}
/man/uns2uns.1 DESTINATION man/man1
)
...
...
cmake/FindUNSIO.cmake
View file @
0becd514
...
...
@@ -24,7 +24,7 @@ if (NOT UNSIO_SETUP)
if
(
UNSIOPATH
)
# user configure cmake with variable -DUNSIO_INSTALLPATH="/unsio/path"
find_library
(
UNSIOLIB NAMES unsio PATHS
${
UNSIOPATH
}
/lib
)
find_library
(
UNSIOLIB NAMES unsio PATHS
${
UNSIOPATH
}
/lib
64
)
MESSAGE
(
STATUS
"UNSIOLIB = "
${
UNSIOLIB
}
)
if
(
NOT
${
UNSIOLIB
}
STREQUAL UNSIOLIB-NOTFOUND
)
MESSAGE
(
STATUS
"Found UNSIOLIB ="
${
UNSIOLIB
}
)
...
...
@@ -33,23 +33,21 @@ if (NOT UNSIO_SETUP)
endif
()
endif
()
if
(
NOT UNSIO_FOUND
)
# try NEMO
MESSAGE
(
STATUS
"UNSIOLIB = "
${
UNSIOLIB
}
" NEMO="
$ENV{NEMO}
)
find_library
(
UNSIOLIB NAMES unsio PATHS $ENV{NEMO}/lib
)
MESSAGE
(
STATUS
"UNSIOLIB = "
${
UNSIOLIB
}
" NEMO="
$ENV{NEMO}
)
if
(
NOT UNSIO_FOUND
)
# try system
MESSAGE
(
STATUS
"Trying UNSIOLIB = "
${
UNSIOLIB
}
" from system=/usr/lib64"
)
find_library
(
UNSIOLIB NAMES unsio PATHS /usr/lib64
)
if
(
NOT
${
UNSIOLIB
}
STREQUAL UNSIOLIB-NOTFOUND
)
MESSAGE
(
STATUS
"Found UNSIOLIB in
NEMO
="
${
UNSIOLIB
}
)
MESSAGE
(
STATUS
"Found UNSIOLIB in
system
="
${
UNSIOLIB
}
)
SET
(
UNSIO_FOUND TRUE
)
SET
(
UNSIOPATH
$ENV{NEMO}
)
MESSAGE
(
STATUS
"
>>>>>22"
$ENV{NEMO}
)
SET
(
UNSIOPATH
/usr
)
MESSAGE
(
STATUS
"
UNSIO found in /usr/lib64"
)
else
()
MESSAGE
(
STATUS
">>>>>2"
)
MESSAGE
(
STATUS
"UNSIO not found in /usr/lib64"
)
endif
()
endif
()
if
(
NOT UNSIO_FOUND
)
# try $HOME/local
find_library
(
UNSIOLIB NAMES unsio PATHS $ENV{HOME}/local/unsio/lib
)
find_library
(
UNSIOLIB NAMES unsio PATHS $ENV{HOME}/local/unsio/lib
64
)
MESSAGE
(
STATUS
"UNSIOLIB = "
${
UNSIOLIB
}
" -- "
$ENV{HOME}
)
if
(
NOT
${
UNSIOLIB
}
STREQUAL UNSIOLIB-NOTFOUND
)
MESSAGE
(
STATUS
"Found UNSIOLIB in $ENV{HOME}/local/unsio/ ="
${
UNSIOLIB
}
)
...
...
py/mains/compare_snapshots.py
View file @
0becd514
...
...
@@ -25,6 +25,7 @@ class snap:
vel
=
None
acc
=
None
pot
=
None
u
=
None
id
=
None
age
=
None
hsml
=
None
...
...
@@ -84,6 +85,7 @@ def readSnap(simname, comp, single):
ok
,
mysnap
.
mass
=
uns
.
getArrayF
(
comp
,
"mass"
)
ok
,
mysnap
.
hsml
=
uns
.
getArrayF
(
comp
,
"hsml"
)
ok
,
mysnap
.
rho
=
uns
.
getArrayF
(
comp
,
"rho"
)
ok
,
mysnap
.
u
=
uns
.
getArrayF
(
comp
,
"u"
)
ok
,
mysnap
.
age
=
uns
.
getArrayF
(
comp
,
"age"
)
ok
,
mysnap
.
acc
=
uns
.
getArrayF
(
comp
,
"acc"
)
ok
,
mysnap
.
pot
=
uns
.
getArrayF
(
comp
,
"pot"
)
...
...
@@ -149,7 +151,7 @@ def notCompare(CA,CB,attr):
def
compare
(
CA
,
CB
,
comp
):
print
(
"-----------------------------------------------------"
)
print
(
"Comparing : <%s> [%s] vs [%s]
\n
"
%
(
comp
,
CA
.
interface
,
CB
.
interface
))
for
attr
in
(
"pos"
,
"vel"
,
"mass"
,
"age"
,
"hsml"
,
"rho"
,
"metal"
,
"acc"
,
"pot"
,
"id"
,
"time"
):
for
attr
in
(
"pos"
,
"vel"
,
"mass"
,
"age"
,
"hsml"
,
"rho"
,
"metal"
,
"acc"
,
"pot"
,
"u"
,
"id"
,
"time"
):
compareArray
(
CA
,
CB
,
attr
)
# -----------------------------------------------------
...
...
py/modules/simulations/ccod.py
View file @
0becd514
...
...
@@ -52,23 +52,27 @@ class CCod:
if
cod_dir_name
is
not
None
:
self
.
__COD_DIR_NAME
=
cod_dir_name
print
(
"SIMNAME ="
,
simname
)
if
analysis
is
None
:
self
.
__dbname
=
dbname
if
self
.
__vdebug
:
print
(
"simname = "
,
simname
,
file
=
sys
.
stderr
)
self
.
simname
=
simname
self
.
__sql3
=
UnsSimu
(
simname
,
dbname
=
self
.
__dbname
,
verbose
=
self
.
__verbose
)
self
.
__r
=
self
.
__sql3
.
getInfo
()
# return None if does not exist
if
simname
is
not
None
:
self
.
__dbname
=
dbname
if
self
.
__vdebug
:
print
(
"simname = "
,
simname
,
file
=
sys
.
stderr
)
self
.
simname
=
simname
self
.
__sql3
=
UnsSimu
(
simname
,
dbname
=
self
.
__dbname
,
verbose
=
self
.
__verbose
)
self
.
__r
=
self
.
__sql3
.
getInfo
()
# return None if does not exist
if
self
.
__vdebug
:
self
.
__sql3
.
printInfo
(
simname
)
self
.
__slist
=
self
.
__sql3
.
getSnapshotList
()
if
self
.
__r
is
not
None
:
self
.
__cod_file_base
=
self
.
__r
[
"dir"
]
+
"/ANALYSIS/"
+
self
.
__COD_DIR_NAME
if
self
.
__vdebug
:
self
.
__sql3
.
printInfo
(
simname
)
self
.
__slist
=
self
.
__sql3
.
getSnapshotList
()
if
self
.
__r
is
not
None
:
self
.
__cod_file_base
=
self
.
__r
[
"dir"
]
+
"/ANALYSIS/"
+
self
.
__COD_DIR_NAME
else
:
message
=
"From CCOD UNS simulation [%s] does not belong to unsio Database"
%
(
self
.
simname
)
raise
Exception
(
message
)
self
.
__is_multiple_halo
=
self
.
__getHaloParticlesNumber
()
#
else
:
message
=
"From CCOD UNS simulation [%s] does not belong to unsio Database"
%
(
self
.
simname
)
raise
Exception
(
message
)
self
.
__is_multiple_halo
=
self
.
__getHaloParticlesNumber
()
#
print
(
"Warning : In COD constructor, you gave None for simname"
,
file
=
sys
.
stderr
)
else
:
print
(
"COD analysis is activated"
,
file
=
sys
.
stderr
)
self
.
__r
=
analysis
.
sim_info
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment