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
nomad-lab
soap-plus-plus
Commits
b1802758
Commit
b1802758
authored
Apr 13, 2016
by
Carl Poelking
Browse files
CMake configuration, RC.
parent
ec50a937
Changes
5
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
b1802758
# CONFIGURE CMAKE
message
(
"CMake version:
${
CMAKE_VERSION
}
"
)
cmake_minimum_required
(
VERSION 2.8.3
)
set
(
CMAKE_INSTALL_PREFIX
${
CMAKE_SOURCE_DIR
}
)
set
(
LOCAL_INSTALL_DIR
${
CMAKE_INSTALL_PREFIX
}
/soap
)
set
(
CMAKE_MODULE_PATH
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake
)
# BUILD OPTIONS
set
(
CMAKE_CXX_STANDARD 11
)
option
(
BUILD_SHARED_LIBS
"Build shared libs"
ON
)
if
(
${
CMAKE_VERSION
}
VERSION_GREATER 3.1
)
message
(
"Setting C++ standard 11 (CMake version > 3.1)"
)
set
(
CMAKE_CXX_STANDARD 11
)
else
(
${
CMAKE_VERSION
}
VERSION_GREATER 3.1
)
message
(
"Setting C++ standard 11 (CMake version <= 3.1)"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-std=c++11"
)
endif
(
${
CMAKE_VERSION
}
VERSION_GREATER 3.1
)
# LOCAL PACKAGES
#set(BOOST_ROOT "/home/cp605/packages/install_boost/boost_1_60_0/libboost")
#set(ESPP_ROOT "/home/cp605/nomad/espressopp")
#set(ESPP_LIBRARIES ${ESPP_ROOT}/_espressopp.so)
#include_directories(${ESPP_INCLUDE_DIRS})
# ...
# FIND PACKAGES
find_package
(
PythonLibs
)
include_directories
(
${
PYTHON_INCLUDE_DIRS
}
)
if
(
DEFINED ENV{BOOST_ROOT}
)
message
(
"-- BOOST_ROOT is set: $ENV{BOOST_ROOT}"
)
else
(
DEFINED ENV{BOOST_ROOT}
)
message
(
"-- Note: BOOST_ROOT not set."
)
endif
(
DEFINED ENV{BOOST_ROOT}
)
find_package
(
Boost COMPONENTS python mpi filesystem serialization
)
include_directories
(
${
Boost_INCLUDE_DIRS
}
)
find_package
(
MPI REQUIRED
)
include_directories
(
${
MPI_INCLUDE_PATH
}
)
find_package
(
FFTW3 REQUIRED
)
include_directories
(
${
FFTW3_INCLUDES
}
)
find_package
(
GSL REQUIRED
)
include_directories
(
${
GSL_INCLUDE_DIRS
}
)
#link_libraries(${ESPP
_LIBRARIES
}
${Boost_LIBRARIES} ${PYTHON_LIBRARIES} ${MPI_LIBRARIES} ${
FFTW3
_LIBRARIES})
set
(
SOAPXX_LINK
_LIBRARIES
${
Boost_LIBRARIES
}
${
PYTHON_LIBRARIES
}
${
MPI_LIBRARIES
}
${
GSL
_LIBRARIES
}
)
# S
OME FRIENDLY MESSAGING
# S
UMMARIZE INCLUDES & LIBS
get_property
(
local_dirs DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
PROPERTY INCLUDE_DIRECTORIES
)
get_property
(
local_libs DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
PROPERTY LINK_LIBRARIES
)
get_property
(
local_libs DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
PROPERTY
SOAPXX_
LINK_LIBRARIES
)
message
(
STATUS
"Include directories: "
)
foreach
(
dir
${
local_dirs
}
)
...
...
@@ -45,9 +51,6 @@ foreach(lib ${local_dirs})
message
(
STATUS
" o
${
lib
}
"
)
endforeach
()
#message(STATUS "Espresso++ lib: ")
#message(STATUS " o ${ESPP_LIBRARIES}")
# SUBDIRECTORIES
add_subdirectory
(
src
)
src/CMakeLists.txt
View file @
b1802758
...
...
@@ -4,8 +4,10 @@ add_library(_soapxx ${LOCAL_SOURCES})
target_link_libraries
(
_soapxx
${
Boost_LIBRARIES
}
${
PYTHON_LIBRARIES
}
${
MPI_LIBRARIES
}
${
GSL_LIBRARIES
}
)
set_target_properties
(
_soapxx PROPERTIES PREFIX
""
SUFFIX
".so"
LIBRARY_OUTPUT_DIRECTORY .
)
configure_file
(
SOAPRC.in SOAPRC @ONLY
)
install
(
TARGETS _soapxx LIBRARY DESTINATION
${
LOCAL_INSTALL_DIR
}
)
install
(
FILES __init__.py DESTINATION
${
LOCAL_INSTALL_DIR
}
)
install
(
FILES __init__.py
${
CMAKE_CURRENT_BINARY_DIR
}
/SOAPRC
DESTINATION
${
LOCAL_INSTALL_DIR
}
)
#install(DIRECTORY linalg DESTINATION ${LOCAL_INSTALL_DIR})
add_subdirectory
(
linalg
)
...
...
src/SOAPRC.in
0 → 100644
View file @
b1802758
# TEST FOR CSH
set is_csh = 101
test "$is_csh" = 101 && goto CSH
# BASH
export PYTHONPATH="${PYTHONPATH}:@CMAKE_INSTALL_PREFIX@"
# CSH/TCSH
CSH:
setenv PYTHONPATH="${PYTHONPATH}:@CMAKE_INSTALL_PREFIX@"
test/test.py
View file @
b1802758
...
...
@@ -22,7 +22,7 @@ element_mass = {
ase_config_list
=
soap
.
tools
.
ase_load_all
(
'configs'
)
for
config
in
ase_config_list
:
print
config
.
config_file
config
=
ase_config_list
[
4
]
config
=
ase_config_list
[
1
]
osio
<<
config
.
atoms
<<
endl
sigma
=
0.5
...
...
@@ -70,14 +70,14 @@ spectrum.save("test_serialization/%s.spectrum.arch" % structure.label)
spectrum
.
save
(
"test_invert/%s.spectrum.arch"
%
structure
.
label
)
spectrum
.
writeDensity
(
1
,
"C"
,
""
)
spectrum
.
writePowerDensity
(
1
,
"C"
,
"
g
"
,
"
c
"
)
#
spectrum.writeDensityOnGrid(1, "C", "")
spectrum
.
writePowerDensity
(
1
,
"C"
,
""
,
""
)
spectrum
.
writeDensityOnGrid
(
1
,
"C"
,
""
)
#spectrum.writeDensityOnGridInverse(1, "C", "g", "c")
# INVERSION
basis
=
spectrum
.
basis
center
=
spectrum
.
getAtomic
(
1
,
"C"
).
getCenter
()
xnkl
=
spectrum
.
getAtomic
(
1
,
"C"
).
getPower
(
"
g
"
,
"
c
"
).
array
xnkl
=
spectrum
.
getAtomic
(
1
,
"C"
).
getPower
(
""
,
""
).
array
ofs
=
open
(
'density.power.python.coeff'
,
'w'
)
for
n
in
range
(
basis
.
N
):
...
...
test/vmdrender.py
View file @
b1802758
...
...
@@ -2,6 +2,7 @@
from
__pyosshell__
import
*
from
vmdtools
import
*
VMDEXE
=
'/home/cp605/packages/install_vmd/vmd/bin/vmd'
TCL
=
'vmdsetup.tcl'
cube
=
'density.expanded.cube'
...
...
@@ -39,8 +40,7 @@ ofs.write('color Name N iceblue\n')
#ofs.write('render Tachyon f75\n')
#ofs.write('exit\n')
ofs
.
close
()
os
.
system
(
'/usr/local/bin/vmd -e %s'
%
TCL
)
os
.
system
(
'%s -e %s'
%
(
VMDEXE
,
TCL
))
#os.system('/sw/linux/vmd-1.8.7/lib/vmd/tachyon_LINUXAMD64 -aasamples 12 %s -res %d %d -format TARGA -o %s.tga' % ('z75', res_x, res_y, 'z75'))
#os.system('/sw/linux/vmd-1.8.7/lib/vmd/tachyon_LINUXAMD64 -aasamples 12 %s -res %d %d -format TARGA -o %s.tga' % ('f75', res_x, res_y, 'f75'))
#os.system('convert z75.tga z75.png')
...
...
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