Skip to content
Commits on Source (5)
This program is developed in the group of Sjors H.W. Scheres at the MRC Laboratory of Molecular Biology,
- Sjors H.W. Scheres
- Shaoda He
- Takanori Nakane
- Jasenko Zivanov
- Liyi Dong
and Erik Lindahl at Stockholm University.
- Erik Lindahl
- Björn O. Forsberg
- Dari Kimanius
This program is developed in the group of Sjors H.W. Scheres at the MRC Laboratory of Molecular Biology.
However, it does also contain pieces of code from the following packages:
XMIPP: http:/xmipp.cnb.csic.es
......
cmake_minimum_required(VERSION 2.8.12)
set(RELION_CMAKE_MINIMUM_REQUIRED_VERSION "2.8.12")
#
#if(POLICY CMP0048)
# cmake_policy(SET CMP0048 NEW)
#endif()
project(Relion)
# Use new policy for OS X @rpath
if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif()
# Add the path to the additional Find<module>.cmake files
# which are included with the distributed RLEION-code
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
add_definitions(-DINSTALL_LIBRARY_DIR=${CMAKE_INSTALL_PREFIX}/lib/)
add_definitions(-DSOURCE_DIR=${CMAKE_SOURCE_DIR}/src/)
# message(STATUS "INSTALL_LIBRARY_DIR set to ${CMAKE_INSTALL_PREFIX}/lib/")
# message(STATUS "SOURCE_DIR set to ${CMAKE_SOURCE_DIR}/src/")
# ------------------------------------------------------------------RPATH SETTINGS--
if(NOT APPLE)
# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# the RPATH to be used when installing, but only if it's not a system directory
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
IF("${isSystemDir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
ENDIF("${isSystemDir}" STREQUAL "-1")
endif(NOT APPLE)
# ---------------------------------------------------------SET SPECIFIC BUILD TYPE--
if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "")
string( TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER )
if( ( NOT ${CMAKE_BUILD_TYPE_LOWER} STREQUAL "none" ) AND
( NOT ${CMAKE_BUILD_TYPE_LOWER} STREQUAL "release" ) AND
( NOT ${CMAKE_BUILD_TYPE_LOWER} STREQUAL "debug" ) AND
( NOT ${CMAKE_BUILD_TYPE_LOWER} STREQUAL "relwithdebinfo" ) AND
( NOT ${CMAKE_BUILD_TYPE_LOWER} STREQUAL "profiling" ) AND
( NOT ${CMAKE_BUILD_TYPE_LOWER} STREQUAL "benchmarking" ) )
message( FATAL_ERROR "CMAKE_BUILD_TYPE : '${CMAKE_BUILD_TYPE}' is not a valid build type. "
"Valid options are: 'None', 'Release', 'Debug', 'RelWithDebInfo', and 'Profiling'." )
endif()
message(STATUS "BUILD TYPE set to '${CMAKE_BUILD_TYPE}'")
SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of
build, options are: 'None', 'Release', 'Debug', 'RelWithDebInfo', and 'Profiling'.")
else()
SET(CMAKE_BUILD_TYPE "Release")
message(STATUS "BUILD TYPE set to the default type: '${CMAKE_BUILD_TYPE}'")
string( TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER )
endif()
# ------------------OPTIONS WHICH ARE NEEDED TO SET BUILD-TYPES (COMPILATION FLAGS)--
# ------------------------------------------------------------------------CUDA-ARCH--
if(NOT DEFINED CUDA_ARCH)
message(STATUS "Setting fallback CUDA_ARCH=35")
set(CUDARCH "-arch=sm_35")
else(NOT DEFINED CUDA_ARCH)
message(STATUS "Using provided CUDA_ARCH=${CUDA_ARCH}")
set(CUDARCH "-arch=sm_${CUDA_ARCH}")
endif(NOT DEFINED CUDA_ARCH)
# -------------------------------------------------------------------FURTHER OPTIONS--
option(CUDA "Enable CUDA GPU acceleration" ON)
option(DoublePrec_CPU "DoublePrec_CPU" ON)
option(DoublePrec_GPU "DoublePrec_GPU" OFF)
option(CudaTexture "CudaTexture" ON)
# -----------------------------------------------DOUBLE PRECISION (CUDA-CODE) OR NOT--
if(DoublePrec_CPU)
message(STATUS "Setting cpu precision to double")
else(DoublePrec_CPU)
message(STATUS "Setting cpu precision to single")
add_definitions(-DRELION_SINGLE_PRECISION)
endif(DoublePrec_CPU)
if(DoublePrec_GPU)
message(STATUS "Setting gpu precision to double")
add_definitions(-DCUDA_DOUBLE_PRECISION)
set(CudaTexture FALSE)
else(DoublePrec_GPU)
message(STATUS "Setting gpu precision to single")
endif(DoublePrec_GPU)
# ----------------------------------------------------------INCLUDE ALL BUILD TYPES--
#This *has* to be AFTER project()
include(${CMAKE_SOURCE_DIR}/cmake/BuildTypes.cmake)
if(CUDA)
# -----------------------------------------------------------------------------CUDA--
# DOC: http://www.cmake.org/cmake/help/v3.0/module/FindCUDA.html
FIND_PACKAGE(CUDA)
endif()
if(CUDA_FOUND)
message(STATUS "Using cuda wrapper to compile....")
if( (NOT ${CUDA_VERSION} VERSION_LESS "7.5") AND (NOT DoublePrec_GPU) )
message(STATUS "Cuda version is >= 7.5 and single-precision build, enable double usage warning.")
set(WARN_DBL "--ptxas-options=-warn-double-usage") # cuda>=7.5
elseif( ${CUDA_VERSION} VERSION_LESS "7.0")
message(WARNING "Cuda version is less than 7.0, so relion will be compiled without GPU support.")
set(CUDA OFF)
endif()
if(CUDA)
add_definitions(-DCUDA)
endif()
else(CUDA_FOUND)
message(STATUS "Using non-cuda compilation....")
endif(CUDA_FOUND)
# ---------------------------------------------------------------USE TEXTURES OR NOT--
if(NOT CudaTexture)
add_definitions(-DCUDA_NO_TEXTURES)
message(STATUS "Texture interpolation is omitted.")
endif(NOT CudaTexture)
# ------------------------------------------------------------------ALLOCATOR CHOICE--
option(CachedAlloc "CachedAlloc" ON)
if(NOT CachedAlloc)
add_definitions(-DCUDA_NO_CUSTOM_ALLOCATION)
message(STATUS "Cashed allocation is disabled.")
endif(NOT CachedAlloc)
option(CustomAllocMemGuards "CustomAllocMemGuards" OFF)
if(CustomAllocMemGuards)
add_definitions(-DCUSTOM_ALLOCATOR_MEMGUARD)
message(STATUS "Abort on out of bound write.")
endif(CustomAllocMemGuards)
# -------------------------------------------------------------FORCE USE OF STL-LIBS--
option(CudaForceSTL "CudaForceSTL" OFF)
if(CudaForceSTL)
add_definitions(-DCUDA_FORCESTL)
message(STATUS "Building cuda files wusing stl-libs for sort, min and max.")
endif(CudaForceSTL)
# ------------------------------------------------------------------------GUI OR NOT--
# Skip FLTK/X11-dependent binaries or not
option(GUI "GUI" ON)
if(NOT GUI)
message(STATUS "Omitting GUI targets as per your request")
endif()
# -------------------------------------------------------------------------------MPI--
find_package(MPI REQUIRED)
include_directories("${MPI_INCLUDE_PATH}")
message(STATUS "MPI_INCLUDE_PATH : ${MPI_INCLUDE_PATH}")
message(STATUS "MPI_LIBRARIES : ${MPI_LIBRARIES}")
message(STATUS "MPI_CXX_INCLUDE_PATH : ${MPI_CXX_INCLUDE_PATH}")
message(STATUS "MPI_CXX_LIBRARIES : ${MPI_CXX_LIBRARIES}")
SET(CMAKE_C_COMPILER ${MPI_C_COMPILER})
SET(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
option(FORCE_OWN_FLTK "FORCE_OWN_FLTK" OFF)
# --------------------------------------------------------------------------X11/FLTK--
FIND_PACKAGE(X11)
if(GUI)
if(X11_FOUND)
set(FLTK_SKIP_OPENGL TRUE) #OpenGL is not required for relion
if(NOT FORCE_OWN_FLTK)
FIND_PACKAGE(FLTK)
if(FLTK_FOUND)
message(STATUS "X11 and FLTK were found")
message(STATUS "FLTK_LIBRARIES: ${FLTK_LIBRARIES}")
else()
message(STATUS "No FLTK installation was found")
endif()
endif(NOT FORCE_OWN_FLTK)
if(NOT FLTK_FOUND)
include(${CMAKE_SOURCE_DIR}/cmake/BuildFLTK.cmake)
set(INSTALL_OWN_FLTK 1)
endif(NOT FLTK_FOUND)
else(X11_FOUND)
message( STATUS "\n-- ------------------ YOU HAVE NO X11-LIBS ------------------")
message( STATUS "CCmake found no X11-libs on your system, which are required for the GUI.")
message( STATUS " You CAN add the flag -DGUI=OFF to avoid using X11" )
message(FATAL_ERROR "X11 is required for GUI.")
endif(X11_FOUND)
endif(GUI)
# ------------------------------------------------------------------------------FFTW--
option(FORCE_OWN_FFTW "FORCE_OWN_FFTW" OFF)
if(NOT FORCE_OWN_FFTW)
FIND_PACKAGE(FFTW)
endif(NOT FORCE_OWN_FFTW)
if(NOT FFTW_FOUND)
message(STATUS "No FFTW installation was found")
include(${CMAKE_SOURCE_DIR}/cmake/BuildFFTW.cmake)
endif(NOT FFTW_FOUND)
include(CheckCXXSymbolExists)
check_cxx_symbol_exists(sincos math.h HAVE_SINCOS)
check_cxx_symbol_exists(__sincos math.h HAVE___SINCOS)
if(HAVE_SINCOS)
add_definitions(-DHAVE_SINCOS)
endif()
if(HAVE___SINCOS)
add_definitions(-DHAVE___SINCOS)
endif()
# ----------------------------------------------------------------------COPY SCRIPTS--
if(FORCE_OWN_FFTW)
install(DIRECTORY external/fftw/lib/ DESTINATION lib FILES_MATCHING PATTERN "*")
endif()
list(APPEND RELION_SCRIPT_FILES star_printtable
star_plottable
star_loopheader
star_datablock_stack
star_datablock_singlefiles
star_datablock_ctfdat
qsub.csh)
add_custom_target(copy_scripts ALL)
foreach (SCRIPT_FILE ${RELION_SCRIPT_FILES})
add_custom_command(TARGET copy_scripts POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy ${CMAKE_SOURCE_DIR}/scripts/${SCRIPT_FILE}
${CMAKE_BINARY_DIR}/bin/relion_${SCRIPT_FILE} )
endforeach()
install( DIRECTORY ${CMAKE_BINARY_DIR}/bin
DESTINATION ${CMAKE_INSTALL_PREFIX}
USE_SOURCE_PERMISSIONS
FILES_MATCHING PATTERN "*")
install(FILES ${CMAKE_SOURCE_DIR}/src/gui_background.xpm DESTINATION lib)
# install fltk if we built our own version
if(INSTALL_OWN_FLTK)
install(DIRECTORY external/fltk/lib/ DESTINATION lib FILES_MATCHING PATTERN "*")
endif()
# -----------------------------------------------------------------RELION COMPONENTS--
option(BUILD_SHARED_LIBS "BUILD_SHARED_LIBS" ON)
if(BUILD_SHARED_LIBS)
message(STATUS "Building shared libs (smaller build size and binaries)")
else()
message(STATUS "Building static libs (larger build size and binaries)")
endif()
ADD_SUBDIRECTORY(src/apps)
# -----------------------------------------------------------------------------TESTS--
# Include testing flag(s) as precomiler
# definitions and include test directives
enable_testing()
include(${CMAKE_SOURCE_DIR}/tests/RelionTests.cmake)
# ----------------------------------------------------------PRINT OUT ALL CMAKE VARS--
#get_cmake_property(_variableNames VARIABLES)
#foreach (_variableName ${_variableNames})
# message(STATUS "${_variableName}=${${_variableName}}")
#endforeach()
Specific Relion Installation Instructions
**************************************************
Note that compilation of the parallel version of RELION needs an
existing MPI installation on your system. We use the open-source
flavour openMPI, but any flavour will probably do. Just make sure the
mpi executables (e.g. mpiCC and mpirun) are in your PATH and the
libraries are in your LD_LIBRARY_PATH. We use the following lines in
our .cshrc:
setenv PATH /public/EM/OpenMPI/bin:$PATH
setenv LD_LIBRARY_PATH /public/EM/OpenMPI/lib:$LD_LIBRARY_PATH
Together with the RELION source code, come tar.gz files for fftw-3.2.2
and fltk-1.3.0. These two external libraries are needed to build
RELION. Standard installation of the whole package, including these
external libraries is performed by executing the following command:
./INSTALL.sh -j 8
Where -j 8 indicates that 8 threads may be used in parallel for
compilation. By default the package will be built inside the relion
directory. Edit the PREFIX variable in the INSTALL.sh script to change
this.
See the RELION wiki pages (http://www2.mrc-lmb.cam.ac.uk/relion) for
more details, e.g. on how to use pre-existing builds of fftw or fltk
on your system.
What follows is only useful if you want to configure RELION in
non-standard ways.
General Automake Installation Instructions
**************************************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need
`configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that the
`configure' script does not know about. Run `./configure --help' for
details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a
time in the source code directory. After you have installed the
package for one architecture, use `make distclean' before reconfiguring
for another architecture.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out automatically,
but needs to determine by the type of machine the package will run on.
Usually, assuming the package is built to be run on the _same_
architectures, `configure' can figure that out, but if it prints a
message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share, you
can create a site shell script called `config.site' that gives default
values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script). Here is a another example:
/bin/bash ./configure CONFIG_SHELL=/bin/bash
Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
configuration-related scripts to be executed by `/bin/bash'.
`configure' Invocation
======================
`configure' recognizes the following options to control how it operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
#!/usr/bin/env sh
#Some flags variables
BUILD_FFTW=true
BUILD_FLTK=true
BUILD_RELION=true
N_THREADS=$@
# Use single-precision instead of the default of double-precision?
FLOAT_PRECISION=false
# do we have mpi and fltk?
HAVE_MPI=true
HAVE_FLTK=true
#Some path variables
RELION_HOME=$PWD
PREFIX=$RELION_HOME
#External libraries versions
VFFTW=fftw-3.2.2
VFLTK=fltk-1.3.0
# Some other vars
GREEN="\033[32m"
ENDC="\033[0m"
#################### FFTW ###########################
# In case Fortran compilation fails consider adding --disable-fortran to the ./configure line below.
if $BUILD_FFTW; then
echo -e "$GREEN Compiling $VFFTW ...$ENDC"
echo -e "See $RELION_HOME/external/fftw_build.log for details"
cd external
tar -zxf $VFFTW.tar.gz
cd $VFFTW
if $FLOAT_PRECISION; then
float_option=" --enable-float "
else
float_option=""
fi
./configure $float_option --enable-threads --enable-shared prefix=$PREFIX > $RELION_HOME/external/fftw_build.log
make $N_THREADS >> $RELION_HOME/external/fftw_build.log
make install >> $RELION_HOME/external/fftw_build.log
cd ../..
fi
#################### FLTK ###########################
if $BUILD_FLTK; then
echo -e "$GREEN Compiling $VFLTK ...$ENDC"
echo -e "See $RELION_HOME/external/fltk_build.log for details"
cd external
tar -zxf $VFLTK.tar.gz
cd $VFLTK
./configure --enable-shared prefix=$PREFIX > $RELION_HOME/external/fltk_build.log
make $N_THREADS >> $RELION_HOME/external/fltk_build.log
make install >> $RELION_HOME/external/fltk_build.log
cd ../..
fi
#################### RELION ###########################
if $BUILD_RELION; then
echo -e "$GREEN Compiling relion ...$ENDC"
echo -e "See $RELION_HOME/relion_build.log for details"
if $HAVE_FLTK; then
fltk_cxx=`$PREFIX/bin/fltk-config --cxxflags`
fltk_ld=`$PREFIX/bin/fltk-config --ldflags`
else
fltk_cxx=""
fltk_ld=""
fi
if $FLOAT_PRECISION; then
float_option=" --enable-float "
else
float_option=""
fi
if $HAVE_MPI; then
mpi_option=" --enable-mpi "
else
mpi_option=""
fi
./configure $mpi_option $float_option prefix=$PREFIX CPPFLAGS="-I$PREFIX/include $fltk_cxx" LDFLAGS="-L$PREFIX/lib $fltk_ld" > $RELION_HOME/relion_build.log
make $N_THREADS >> $RELION_HOME/relion_build.log
make install >> $RELION_HOME/relion_build.log
mv $RELION_HOME/bin/relion_maingui $PREFIX/bin/relion
cp $RELION_HOME/scripts/qsub.csh $PREFIX/bin/qsub.csh
fi
echo "Done!"
## LibRelion:
## Place generated object files (.o) into the same directory as their source
## files, in order to avoid collisions when non-recursive make is used.
AUTOMAKE_OPTIONS = subdir-objects
## Additional flags to pass to aclocal when it is invoked automatically at
## make time. The ${ACLOCAL_FLAGS} variable is picked up from the environment
## to provide a way for the user to supply additional arguments.
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
## Define an independent executable script for inclusion in the distribution
## archive. However, it will not be installed on an end user's system due to
## the noinst_ prefix.
dist_noinst_SCRIPTS = autogen.sh
# Install my_script in $(bindir) and distribute it.
dist_bin_SCRIPTS = \
scripts/star_datablock_ctfdat \
scripts/star_datablock_stack \
scripts/star_datablock_singlefiles \
scripts/star_loopheader \
scripts/star_plottable \
scripts/star_printtable \
scripts/qsub.csh
### Include tar.gz of FFTW and FLTK in distribution, as well as all source files for the GUI
EXTRA_DIST = INSTALL.sh \
external/fftw-3.2.2.tar.gz \
external/fltk-1.3.0.tar.gz
###############################################################################
#
# Core library
#
###############################################################################
## Define a libtool archive target "librelion-@RELION_API_VERSION@.la", with
## @RELION_API_VERSION@ substituted into the generated Makefile at configure
## time.
## The libtool archive file (.la) will be installed into the directory named
## by the predefined variable $(bindir), along with the actual shared library
## file (.so).
lib_LTLIBRARIES = librelion-@RELION_API_VERSION@.la
## Define the source file list for the "librelion-@RELION_API_VERSION@.la"
## target. Note that @RELION_API_VERSION@ is not interpreted by Automake and
## will therefore be treated as if it were literally part of the target name,
## and the variable name derived from that.
## The file extension .cc is recognized by Automake, and makes it produce
## rules which invoke the C++ compiler to produce a libtool object file (.lo)
## from each source file. Note that it is not necessary to list header files
## which are already listed elsewhere in a _HEADERS variable assignment.
librelion_@RELION_API_VERSION@_la_SOURCES = src/args.cpp \
src/assembly.cpp \
src/autopicker.cpp \
src/backprojector.cpp \
src/complex.cpp \
src/ctf.cpp \
src/ctffind_runner.cpp \
src/error.cpp \
src/euler.cpp \
src/exp_model.cpp \
src/fftw.cpp \
src/filename.cpp \
src/funcs.cpp \
src/healpix_sampling.cpp \
src/image.cpp \
src/mask.cpp \
src/matrix1d.cpp \
src/matrix2d.cpp \
src/memory.cpp \
src/metadata_container.cpp \
src/metadata_label.cpp \
src/metadata_table.cpp \
src/ml_model.cpp \
src/ml_optimiser.cpp \
src/multidim_array.cpp \
src/numerical_recipes.cpp \
src/parallel.cpp \
src/particle_polisher.cpp \
src/particle_sorter.cpp \
src/postprocessing.cpp \
src/preprocessing.cpp \
src/projector.cpp \
src/strings.cpp \
src/symmetries.cpp \
src/tabfuncs.cpp \
src/time.cpp \
src/transformations.cpp \
src/Healpix_2.15a/cxxutils.cc \
src/Healpix_2.15a/healpix_base.cc
## Define the list of public header files and their install location. The
## nobase_ prefix instructs Automake to not strip the directory part from each
## filename, in order to avoid the need to define separate file lists for each
## installation directory. This only works if the directory hierarchy in the
## source tree matches the hierarchy at the install location, however.
relion_includedir = $(includedir)/relion-$(RELION_API_VERSION)
nobase_relion_include_HEADERS = relion.h \
src/args.h \
src/assembly.h \
src/autopicker.h \
src/backprojector.h \
src/complex.h \
src/ctf.h \
src/ctffind_runner.h \
src/displayer.h \
src/error.h \
src/euler.h \
src/exp_model.h \
src/fftw.h \
src/filename.h \
src/funcs.h \
src/gcc_version.h \
src/gui_entries.h \
src/gui_jobwindow.h \
src/gui_mainwindow.h \
src/healpix_sampling.h \
src/image.h \
src/macros.h \
src/mask.h \
src/matrix1d.h \
src/matrix2d.h \
src/memory.h \
src/metadata_container.h \
src/metadata_label.h \
src/metadata_table.h \
src/ml_model.h \
src/ml_optimiser.h \
src/multidim_array.h \
src/numerical_recipes.h \
src/parallel.h \
src/particle_polisher.h \
src/particle_sorter.h \
src/postprocessing.h \
src/preprocessing.h \
src/projector.h \
src/rwIMAGIC.h \
src/rwMRC.h \
src/rwSPIDER.h \
src/strings.h \
src/symmetries.h \
src/tabfuncs.h \
src/time.h \
src/transformations.h \
src/Healpix_2.15a/arr.h \
src/Healpix_2.15a/cxxutils.h \
src/Healpix_2.15a/datatypes.h \
src/Healpix_2.15a/geom_utils.h \
src/Healpix_2.15a/lsconstants.h \
src/Healpix_2.15a/message_error.h \
src/Healpix_2.15a/openmp_support.h \
src/Healpix_2.15a/pointing.h \
src/Healpix_2.15a/vec3.h \
src/Healpix_2.15a/healpix_base.h
if HAVE_MPI
librelion_@RELION_API_VERSION@_la_SOURCES += src/mpi.cpp \
src/autopicker_mpi.cpp \
src/ctffind_runner_mpi.cpp \
src/particle_polisher_mpi.cpp \
src/particle_sorter_mpi.cpp \
src/preprocessing_mpi.cpp \
src/ml_optimiser_mpi.cpp
nobase_relion_include_HEADERS += src/mpi.h \
src/autopicker_mpi.h \
src/ctffind_runner_mpi.h \
src/particle_polisher_mpi.h \
src/particle_sorter_mpi.h \
src/preprocessing_mpi.h \
src/ml_optimiser_mpi.h
endif
if HAVE_FLTK
librelion_@RELION_API_VERSION@_la_SOURCES += src/displayer.cpp \
src/gui_entries.cpp \
src/gui_jobwindow.cpp \
src/gui_mainwindow.cpp \
src/manualpicker.cpp
nobase_relion_include_HEADERS += src/displayer.h \
src/gui_entries.h \
src/gui_jobwindow.h \
src/gui_mainwindow.h \
src/manualpicker.h
endif
## Instruct libtool to include ABI version information in the generated shared
## library file (.so). The library ABI version is defined in configure.ac, so
## that all version information is kept in one place.
librelion_@RELION_API_VERSION@_la_LDFLAGS = -version-info $(RELION_SO_VERSION) $(FFT_LIBS)
## The generated configuration header is installed in its own subdirectory of
## $(libdir). The reason for this is that the configuration information put
## into this header file describes the target platform the installed library
## has been built for. Thus the file must not be installed into a location
## intended for architecture-independent files, as defined by the Filesystem
## Hierarchy Standard (FHS).
relion_libincludedir = $(libdir)/relion-$(RELION_API_VERSION)/include
## Install the generated pkg-config file (.pc) into the expected location for
## architecture-dependent package configuration information. Occasionally,
## pkg-config files are also used for architecture-independent data packages,
## in which case the correct install location would be $(datadir)/pkgconfig.
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = relion-$(RELION_API_VERSION).pc
###############################################################################
#
# Applications
#
###############################################################################
bin_PROGRAMS = project reconstruct refine preprocess postprocess autopick particle_polish particle_sort run_ctffind star_compare find_tiltpairs tiltpair_plot
if HAVE_MPI
bin_PROGRAMS += refine_mpi preprocess_mpi autopick_mpi particle_polish_mpi particle_sort_mpi run_ctffind_mpi
endif
if HAVE_FLTK
bin_PROGRAMS += manualpick display maingui
endif
RelionLibs = librelion-$(RELION_API_VERSION).la
refine_SOURCES = src/apps/refine.cpp
refine_LDADD = $(RelionLibs)
refine_mpi_SOURCES = src/apps/refine_mpi.cpp
refine_mpi_LDADD = $(RelionLibs)
reconstruct_SOURCES = src/apps/reconstruct.cpp
reconstruct_LDADD = $(RelionLibs)
project_SOURCES = src/apps/project.cpp
project_LDADD = $(RelionLibs)
postprocess_SOURCES = src/apps/postprocess.cpp
postprocess_LDADD = $(RelionLibs)
preprocess_SOURCES = src/apps/preprocess.cpp
preprocess_LDADD = $(RelionLibs)
preprocess_mpi_SOURCES = src/apps/preprocess_mpi.cpp
preprocess_mpi_LDADD = $(RelionLibs)
autopick_SOURCES = src/apps/autopick.cpp
autopick_LDADD = $(RelionLibs)
autopick_mpi_SOURCES = src/apps/autopick_mpi.cpp
autopick_mpi_LDADD = $(RelionLibs)
manualpick_SOURCES = src/apps/manualpick.cpp
manualpick_LDADD = $(RelionLibs)
particle_polish_SOURCES = src/apps/particle_polish.cpp
particle_polish_LDADD = $(RelionLibs)
particle_polish_mpi_SOURCES = src/apps/particle_polish_mpi.cpp
particle_polish_mpi_LDADD = $(RelionLibs)
particle_sort_SOURCES = src/apps/particle_sort.cpp
particle_sort_LDADD = $(RelionLibs)
particle_sort_mpi_SOURCES = src/apps/particle_sort_mpi.cpp
particle_sort_mpi_LDADD = $(RelionLibs)
run_ctffind_SOURCES = src/apps/run_ctffind.cpp
run_ctffind_LDADD = $(RelionLibs)
run_ctffind_mpi_SOURCES = src/apps/run_ctffind_mpi.cpp
run_ctffind_mpi_LDADD = $(RelionLibs)
star_compare_SOURCES = src/apps/star_compare.cpp
star_compare_LDADD = $(RelionLibs)
display_SOURCES = src/apps/display.cpp
display_LDADD = $(RelionLibs)
maingui_SOURCES = src/apps/maingui.cpp
maingui_LDADD = $(RelionLibs)
bin_PROGRAMS += mask_create
mask_create_SOURCES = src/apps/mask_create.cpp
mask_create_LDADD = $(RelionLibs)
bin_PROGRAMS += stack_create
stack_create_SOURCES = src/apps/stack_create.cpp
stack_create_LDADD = $(RelionLibs)
bin_PROGRAMS += image_handler
image_handler_SOURCES = src/apps/image_handler.cpp
image_handler_LDADD = $(RelionLibs)
bin_PROGRAMS += find_tiltpairs
find_tiltpairs_SOURCES = src/apps/find_tiltpairs.cpp
find_tiltpairs_LDADD = $(RelionLibs)
#bin_PROGRAMS += subtomo_proj3d_correct
#subtomo_proj3d_correct_SOURCES = src/apps/subtomo_proj3d_correct.cpp
#subtomo_proj3d_correct_LDADD = $(RelionLibs)
#bin_PROGRAMS += subtomo_angle_converter
#subtomo_angle_converter_SOURCES = src/apps/subtomo_angle_converter.cpp
#subtomo_angle_converter_LDADD = $(RelionLibs)
bin_PROGRAMS += tiltpair_plot
tiltpair_plot_SOURCES = src/apps/tiltpair_plot.cpp
tiltpair_plot_LDADD = $(RelionLibs)
This diff is collapsed.
RELION (for REgularised LIkelihood OptimisatioN) is a stand-alone computer program for Maximum A Posteriori refinement of (multiple) 3D reconstructions or 2D class averages in cryo-electron microscopy. It is developed in the research group of Sjors Scheres at the MRC Laboratory of Molecular Biology. The underlying theory of MAP refinement is given in a scientific publication: Scheres, JMB (2011) (DOI: 10.1016/j.jmb.2011.11.010). If RELION is useful in your work, please cite this paper.
The documentation of RELION is stored on the following Wiki page:
http://www2.mrc-lmb.cam.ac.uk/relion
The INSTALL.sh script is provided for convenient installation. Please see the above-mentioned Wiki for more information.
RELION
======
RELION (for REgularised LIkelihood OptimisatioN) is a stand-alone computer
program for Maximum A Posteriori refinement of (multiple) 3D reconstructions
or 2D class averages in cryo-electron microscopy. It is developed in the
research group of Sjors Scheres at the MRC Laboratory of Molecular Biology.
The underlying theory of MAP refinement is given in a [scientific publication](https://www.ncbi.nlm.nih.gov/pubmed/22100448)
. If RELION is useful in your work, please cite this paper.
The more comprehensive documentation of RELION is stored on the [Wiki](http://www2.mrc-lmb.cam.ac.uk/relion)
## Installation
More extensive options and configurations are available
[here](http://www2.mrc-lmb.cam.ac.uk/relion/index.php/Download_%26_install),
but the outlines to clone and install relion for typical use are made easy
through [cmake](https://en.wikipedia.org/wiki/CMake).
On ubuntu machines, installing cmake, the compiler, and additional dependencies (mpi, fftw) is as easy as:
```
sudo apt install cmake build-essential mpi-default-bin mpi-default-dev libfftw3-dev
```
On other systems it is typically just as easy, you simply have to modify "apt" to
the appropriate package manager. You will also need [git](https://en.wikipedia.org/wiki/Git), which is just as easy;
```
sudo apt install git
```
Once git and cmake are installed, relion can be easily installed through
```
git clone https://github.com/3dem/relion.git
cd relion
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/where/to/install/ ..
make -j4
make install
```
(NOTES: "/where/to/install/.." is typically "/usr/local/relion".
Make sure you create this directory beforehand.
Installing to that location requires sudo, so in this case be sure to use
"sudo make install" instead of "make install" in the last step.)
These steps will download the source-code, create a build-directory,
then configure and build relion, and lastly install it to be generally
available on the system.
## Updating
RELION is intermittently updated, with both minor and major features.
To update an existing installation, simply use the following commands
```
cd relion
git pull
cd build
make -j4
make install # (or "sudo make install")
```
This diff is collapsed.
#Some path variables
setenv RELION_HOME $PWD
setenv PREFIX $RELION_HOME
autoreconf --install
setenv fltk_cxx `fltk-config --cxxflags`
setenv fltk_ld `fltk-config --ldflags`
./configure --enable-mpi CPPFLAGS="-I/lmb/home/scheres/app/fftw-3.2.2/include -I$PREFIX/include $fltk_cxx" LDFLAGS="-L/lmb/home/scheres/app/fftw-3.2.2/lib -L$PREFIX/lib $fltk_ld"
set(FFTW_EXTERNAL_PATH "${CMAKE_SOURCE_DIR}/external/fftw")
if (NOT DEFINED TARGET_X86)
try_compile(TARGET_X86 ${CMAKE_BINARY_DIR}
"${CMAKE_SOURCE_DIR}/cmake/TestX86.c")
endif()
if(DoublePrec_CPU)
# set fftw lib to use double precision
set(libfft "fftw3")
set(ext_conf_flags_fft --enable-shared --prefix=${FFTW_EXTERNAL_PATH})
if(TARGET_X86)
set(ext_conf_flags_fft ${ext_conf_flags_fft} --enable-sse2 --enable-avx)
endif()
else(DoublePrec_CPU)
# set fftw lib to use single precision
set(libfft "fftw3f")
set(ext_conf_flags_fft --enable-shared --enable-float --prefix=${FFTW_EXTERNAL_PATH})
if(TARGET_X86)
set(ext_conf_flags_fft ${ext_conf_flags_fft} --enable-sse --enable-avx)
endif()
endif(DoublePrec_CPU)
## ------------------------------------------------------------- PREVIOUS EXT LIBS? --
find_path(FFTW_INCLUDES NAMES fftw3.h PATHS ${FFTW_EXTERNAL_PATH}/include NO_DEFAULT_PATH)
find_library(FFTW_LIBRARIES NAMES ${libfft} PATHS ${FFTW_EXTERNAL_PATH}/lib NO_DEFAULT_PATH)
if(FFTW_INCLUDES AND FFTW_LIBRARIES)
set(FFTW_FOUND TRUE)
message(STATUS "Found previously built non-system FFTW libraries that will be used.")
else()
set(FFTW_FOUND FALSE)
message(STATUS "--------------------------------------------------------")
message(STATUS "-------- NO EXISTING FFTW LIBRARIES WHERE FOUND. -------")
message(STATUS "-------------- FFTW WILL BE DOWNLOADED AND -------------")
message(STATUS "--------------- BUILT DURING COMPILE-TIME. -------------")
message(STATUS "--------------------------------------------------------")
message(STATUS "---- A WORKING INTERNET CONNECTION WILL BE REQUIRED. ---")
message(STATUS "--------------------------------------------------------")
endif()
## ----------------------------------------------------------------- NEW EXT LIBS? --
if(NOT FFTW_FOUND)
set(FFTW_LIBRARIES ${FFTW_EXTERNAL_PATH}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}${libfft}${CMAKE_SHARED_LIBRARY_SUFFIX})
set(FFTW_PATH "${FFTW_EXTERNAL_PATH}" )
set(FFTW_INCLUDES "${FFTW_EXTERNAL_PATH}/include" )
include(ExternalProject)
set(FFTW_EXTERNAL_LIBS_TAR_DIRECTORY ${FFTW_EXTERNAL_PATH})
set(FFTW_EXTERNAL_LIBS_EXTRACT_TARGET ${FFTW_EXTERNAL_LIBS_TAR_DIRECTORY})
message( STATUS "no previous fftw found, the following paths are set for libs/headers TO BE built")
set(FFTW_FFTW3_TAR_FILE ftp://ftp.fftw.org/pub/fftw/fftw-3.3.4.tar.gz)
#set(FFTW_FFTW3_TAR_FILE https://drive.google.com/uc?export=download&id=0B942d76zVnSeazZWcExRaXIyVDg) #backup location fftw-3.3.4
#set(FFTW_TAR_NAME fftw-3.3.4.tar.gz)
set(FFTW_FFTW3_LIB_DIR ${FFTW_EXTERNAL_LIBS_EXTRACT_TARGET}/fftw3)
set(FFTW_FFTW3_BUILD_DIR ${FFTW_EXTERNAL_LIBS_EXTRACT_TARGET}/fftw3-build)
#set(CMAKE_INSTALL_PREFIX ${FFTW_EXTERNAL_PATH})
externalproject_add(OWN_FFTW
URL ${FFTW_FFTW3_TAR_FILE}
URL_MD5 2edab8c06b24feeb3b82bbb3ebf3e7b3
DOWNLOAD_DIR ${FFTW_EXTERNAL_LIBS_TAR_DIRECTORY}
SOURCE_DIR ${FFTW_FFTW3_LIB_DIR}
CONFIGURE_COMMAND <SOURCE_DIR>/configure ${ext_conf_flags_fft}
INSTALL_DIR ${FFTW_EXTERNAL_PATH}/fftw3
BINARY_DIR ${FFTW_EXTERNAL_PATH}/fftw3
BUILD_COMMAND ${MAKE}
# LOG_CONFIGURE
# LOG_BUILD
LOG_INSTALL)
set(BUILD_OWN_FFTW TRUE)
else()
set(BUILD_OWN_FFTW FALSE)
endif()
message(STATUS "FFTW_INCLUDES: ${FFTW_INCLUDES}")
message(STATUS "FFTW_LIBRARIES: ${FFTW_LIBRARIES}")
set(FLTK_EXTERNAL_PATH "${CMAKE_SOURCE_DIR}/external/fltk")
set(ext_conf_flags_fltk --enable-shared --prefix=${FLTK_EXTERNAL_PATH})
## ------------------------------------------------------------- PREVIOUS EXT LIBS? --
find_library(FLTK_LIBRARIES NAMES fltk PATHS "${FLTK_EXTERNAL_PATH}/lib" NO_DEFAULT_PATH)
find_path(FLTK_INCLUDE_DIR NAMES FL/Fl.H PATHS "${FLTK_EXTERNAL_PATH}/include" NO_DEFAULT_PATH)
find_path(FLTK_INCLUDES NAMES FL/Fl.H PATHS "${FLTK_EXTERNAL_PATH}/include" NO_DEFAULT_PATH)
if(FLTK_INCLUDE_DIR AND FLTK_LIBRARIES)
set(FLTK_FOUND TRUE)
message(STATUS "Found previously built non-system FLTK libraries that will be used.")
else()
set(FLTK_FOUND FALSE)
message(STATUS "--------------------------------------------------------")
message(STATUS "-------- NO EXISTING FLTK LIBRARIES WHERE FOUND. -------")
message(STATUS "-------------- FLTK WILL BE DOWNLOADED AND -------------")
message(STATUS "--------------- BUILT DURING COMPILE-TIME. -------------")
message(STATUS "--------------------------------------------------------")
message(STATUS "---- A WORKING INTERNET CONNECTION WILL BE REQUIRED. ---")
message(STATUS "--------------------------------------------------------")
endif()
## ----------------------------------------------------------------- NEW EXT LIBS? --
if(NOT FLTK_FOUND)
set(FLTK_LIBRARIES "${FLTK_EXTERNAL_PATH}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}fltk${CMAKE_SHARED_LIBRARY_SUFFIX}" )
set(FLTK_INCLUDE_DIR "${FLTK_EXTERNAL_PATH}/include" )
include(ExternalProject)
set(FLTK_EXTERNAL_LIBS_TAR_DIRECTORY ${FLTK_EXTERNAL_PATH})
set(FLTK_EXTERNAL_LIBS_EXTRACT_TARGET ${FLTK_EXTERNAL_LIBS_TAR_DIRECTORY})
message(STATUS "no previous fltk found, the following paths are set for libs/headers TO BE built")
#set(FLTK_TAR_FILE https://drive.google.com/uc?export=download&id=0B942d76zVnSeUWgyaklWOFZlN2s) # FLTK 1.3.0
#set(FLTK_HASH cf3687ed404bd72347466663b90a8b09)
#set(FLTK_TAR_NAME fltk-1.3.0.tar.gz)
set(FLTK_TAR_FILE https://drive.google.com/uc?export=download&id=0B942d76zVnSeazZWcExRaXIyVDg) # FLTK 1.3.3
set(FLTK_HASH 9ccdb0d19dc104b87179bd9fd10822e3)
set(FLTK_TAR_NAME fltk-1.3.3-source.tar.gz)
set(FLTK_LIB_DIR ${FLTK_EXTERNAL_LIBS_EXTRACT_TARGET}/fltk)
set(FLTK_BUILD_DIR ${FLTK_EXTERNAL_LIBS_EXTRACT_TARGET}/fltk-build)
#set(CMAKE_INSTALL_PREFIX ${FLTK_EXTERNAL_PATH})
externalproject_add(OWN_FLTK
URL ${FLTK_TAR_FILE}
# TIMEOUT 15
URL_MD5 ${FLTK_HASH}
DOWNLOAD_DIR ${FLTK_EXTERNAL_LIBS_TAR_DIRECTORY}
DOWNLOAD_NAME ${FLTK_TAR_NAME}
SOURCE_DIR ${FLTK_LIB_DIR}
PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/cmake/fltk-1.3.3.patch
CONFIGURE_COMMAND <SOURCE_DIR>/configure ${ext_conf_flags_fltk}
INSTALL_DIR ${FLTK_EXTERNAL_PATH}/fltk
BINARY_DIR ${FLTK_EXTERNAL_PATH}/fltk
BUILD_COMMAND ${MAKE}
# LOG_CONFIGURE
# LOG_BUILD
LOG_INSTALL)
set(BUILD_OWN_FLTK TRUE)
else()
set(BUILD_OWN_FLTK FALSE)
endif()
message(STATUS "FLTK_INCLUDE_DIR: ${FLTK_INCLUDE_DIR}")
message(STATUS "FLTK_LIBRARIES: ${FLTK_LIBRARIES}")
# Extra flags defined on each build type (this file is all optional to include)
#
# Because gcc is compliant with a float128 type, fftw has become as well. nvcc is NOT.
# So -D__INTEL_COMPILER just manages to avoid compiling float128-targets (see fftw3.h, for instance).
# Add -G to allow cuda-gdb to break inside kernels.
set(EXTRA_NVCC_FLAGS "-D__INTEL_COMPILER --default-stream per-thread")
set(RELION_NVCC_FLAGS "${CUDARCH} ${WARN_DBL} ${EXTRA_NVCC_FLAGS}" CACHE STRING "" FORCE)
#message(STATUS "RELION_NVCC_FLAGS: ${RELION_NVCC_FLAGS}")
# --------------------------
# Debug BUILD
# --------------------------
# Additional useful nvcc-flags for debugging
#
# -keep Keep all intermediate files that are generated during internal compilation steps.
# --resource-usage how resource usage such as registers and memeory of the GPU code. This option implies
# --nvlink-options=--verbose when --relocatable-device-code=true is set. Otherwise,
# it implies --ptxas-options=--verbose.
# -- Compiler flags -------------------------------------------------
set(RELION_FLAGS_DEBUG "-O0" CACHE STRING "")
set(RELION_NVCC_FLAGS_DEBUG "${RELION_NVCC_FLAGS}" CACHE STRING "")
# -- Linker flags ---------------------------------------------------
set(RELION_LINKER_FLAGS_DEBUG " ")
# -- Append compiler and linker flags -------------------------------
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${RELION_FLAGS_DEBUG}" CACHE STRING "")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${RELION_FLAGS_DEBUG}" CACHE STRING "")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${RELION_LINKER_FLAGS_DEBUG}" CACHE STRING "")
set(CUDA_NVCC_FLAGS_DEBUG "${RELION_NVCC_FLAGS_DEBUG}" CACHE STRING "")
# -- Add preprocessor defintions ------------------------------------
set(RELION_DEFINITIONS_DEBUG "-DDEBUG_CUDA")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${RELION_DEFINITIONS_DEBUG}")
#message(STATUS "Set the extra flags for Debug build type")
#message(STATUS "RELION_NVCC_FLAGS_DEBUG : ${RELION_NVCC_FLAGS_DEBUG}")
#message(STATUS "CUDA_NVCC_FLAGS_DEBUG : ${CUDA_NVCC_FLAGS_DEBUG}")
#message(STATUS "CMAKE_CXX_FLAGS_DEBUG : ${CMAKE_CXX_FLAGS_DEBUG}")
#--------------------------------------------------------------------
# --------------------------
# RELWITHDEBINFO BUILD
# --------------------------
# -- Compiler flags -------------------------------------------------
set(RELION_NVCC_FLAGS_RELWITHDEBINFO "${RELION_NVCC_FLAGS}" CACHE STRING "")
# -- Linker flags ---------------------------------------------------
set(RELION_LINKER_FLAGS_RELWITHDEBINFO " ")
# -- Append compiler and linker flags -------------------------------
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${RELION_FLAGS_RELWITHDEBINFO}" CACHE STRING "")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${RELION_FLAGS_RELWITHDEBINFO}" CACHE STRING "")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} ${RELION_LINKER_FLAGS_RELWITHDEBINFO}" CACHE STRING "")
set(CUDA_NVCC_FLAGS_RELWITHDEBINFO "${RELION_NVCC_FLAGS_RELWITHDEBINFO}" CACHE STRING "")
# -- Add preprocessor defintions ------------------------------------
set(RELION_DEFINITIONS_RELWITHDEBINFO "-DDEBUG_CUDA")
#message(STATUS "Set the extra flags for RELWITHDEBINFO build type")
#message(STATUS "RELION_NVCC_FLAGS_RELWITHDEBINFO : ${RELION_NVCC_FLAGS_RELWITHDEBINFO}")
#message(STATUS "CUDA_NVCC_FLAGS_RELWITHDEBINFO : ${CUDA_NVCC_FLAGS_RELWITHDEBINFO}")
#message(STATUS "CMAKE_CXX_FLAGS_RELWITHDEBINFO : ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
#--------------------------------------------------------------------
# --------------------------
# Release BUILD
# --------------------------
# Additional useful nvcc-flags for optimization
#
# --use_fast_math
# --prec-div This option controls single-precision floating-point division and reciprocals.
# --prec-div=true enables the IEEE round-to-nearest mode and --prec-div=false enables
# the fast approximation mode. --use_fast_math implies --prec-div=false.
# --prec-sqrt -||- sqrt
# --fmad This option enables (disables) the contraction of floating-point multiplies and
# adds/subtracts into floating-point multiply-add operations (FMAD, FFMA, or DFMA).
# --use_fast_math implies --fmad=true.
# --restrict Programmer assertion that all kernel pointer parameters are restrict pointers.
# -- Compiler flags -------------------------------------------------
set(RELION_FLAGS_RELEASE "" CACHE STRING "")
set(RELION_NVCC_FLAGS_RELEASE "${RELION_NVCC_FLAGS} --disable-warnings" CACHE STRING "")
# -- Linker flags ---------------------------------------------------
set(RELION_LINKER_FLAGS_RELEASE "")
# -- Append compiler and linker flags -------------------------------
#message(STATUS "CCF_RELEASE : ${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${RELION_FLAGS_RELEASE}" CACHE STRING "")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${RELION_FLAGS_RELEASE}" CACHE STRING "")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${RELION_LINKER_FLAGS_RELEASE}" CACHE STRING "")
set(CUDA_NVCC_FLAGS_RELEASE "${RELION_NVCC_FLAGS_RELEASE}" CACHE STRING "")
# -- Add preprocessor defintions ------------------------------------
set(RELION_DEFINITIONS_RELEASE "")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${RELION_DEFINITIONS_RELEASE}")
#message(STATUS "RELION_FLAGS_PROFILING : ${RELION_FLAGS_PROFILING}")
#message(STATUS "CMAKE_CXX_FLAGS_PROFILING : ${CMAKE_CXX_FLAGS_PROFILING}")
#--------------------------------------------------------------------
# ----------------------------------
# NVIDIA Profiling BUILD
# (Release for nvprof)
# ----------------------------------
# ** NOTE: this will not have overall Release perf. **
# Additional useful nvcc-flags for profiling
#
# -pg gprof profiling output (needs linker flag)
# --resource-usage how resource usage such as registers and memeory of the GPU code. This option implies
# --nvlink-options=--verbose when --relocatable-device-code=true is set. Otherwise,
# it implies --ptxas-options=--verbose#
# -- Compiler flags -------------------------------------------------
set(RELION_FLAGS_PROFILING "" CACHE STRING "")
set(RELION_NVCC_FLAGS_PROFILING "${RELION_NVCC_FLAGS} -lineinfo" CACHE STRING "")
# -- Linker flags ---------------------------------------------------
set(RELION_LINKER_FLAGS_PROFILING "")
# -- Append compiler and linker flags -------------------------------
set(CMAKE_CXX_FLAGS_PROFILING "${CMAKE_CXX_FLAGS_RELEASE} ${RELION_FLAGS_PROFILING}" CACHE STRING "")
set(CMAKE_C_FLAGS_PROFILING "${CMAKE_C_FLAGS_RELEASE} ${RELION_FALAGS_PROFILING}" CACHE STRING "")
set(CMAKE_EXE_LINKER_FLAGS_PROFILING "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${RELION_LINKER_FLAGS_PROFILING}" CACHE STRING "")
set(CUDA_NVCC_FLAGS_PROFILING "${RELION_NVCC_FLAGS_PROFILING}" CACHE STRING "")
# -- Add preprocessor defintions ------------------------------------
set(RELION_DEFINITIONS_PROFILING "-DCUDA_PROFILING")
set(CMAKE_CXX_FLAGS_PROFILING "${CMAKE_CXX_FLAGS_PROFILING} ${RELION_DEFINITIONS_PROFILING}")
#message(STATUS "RELION_FLAGS_PROFILING : ${RELION_FLAGS_PROFILING}")
#message(STATUS "CMAKE_CXX_FLAGS_PROFILING : ${CMAKE_CXX_FLAGS_PROFILING}")
#--------------------------------------------------------------------
# ----------------------------------
# Benchmarking BUILD
# (Release with profiling output)
# ----------------------------------
# -- Compiler flags -------------------------------------------------
set(RELION_FLAGS_BENCHMARKING "" CACHE STRING "")
set(RELION_NVCC_FLAGS_BENCHMARKING "${RELION_NVCC_FLAGS} " CACHE STRING "")
# -- Linker flags ---------------------------------------------------
set(RELION_LINKER_FLAGS_BENCHMARKING "")
# -- Append compiler and linker flags -------------------------------
set(CMAKE_CXX_FLAGS_BENCHMARKING "${CMAKE_CXX_FLAGS_RELEASE} ${RELION_FLAGS_BENCHMARKING}" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_BENCHMARKING "${CMAKE_C_FLAGS_RELEASE} ${RELION_FLAGS_BENCHMARKING}" CACHE STRING "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_BENCHMARKING "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${RELION_LINKER_FLAGS_BENCHMARKING}" CACHE STRING "" FORCE)
set(CUDA_NVCC_FLAGS_BENCHMARKING "${RELION_NVCC_FLAGS_BENCHMARKING}" CACHE STRING "" FORCE)
# -- Add preprocessor defintions ------------------------------------
set(RELION_DEFINITIONS_BENCHMARKING "-DCUDA_BENCHMARK -DTIMING")
set(CMAKE_CXX_FLAGS_BENCHMARKING "${CMAKE_CXX_FLAGS_BENCHMARKING} ${RELION_DEFINITIONS_BENCHMARKING}")
#--------------------------------------------------------------------
# CMake helper to locate the needed libraries and headers
# for compilation of RELION binaries.
#
set(FFTW_EXTERNAL_PATH "${CMAKE_SOURCE_DIR}/external/fftw")
if(DoublePrec_CPU)
# set fftw lib to use double precision
set(libfft "fftw3")
else(DoublePrec_CPU)
# set fftw lib to use single precision
set(libfft "fftw3f")
endif(DoublePrec_CPU)
set(LIB_PATHFFT $ENV{FFTW_LIB})
set(INC_PATHFFT $ENV{FFTW_INCLUDE})
unset(FFTW_PATH CACHE)
unset(FFTW_INCLUDES CACHE)
unset(FFTW_LIBRARIES CACHE)
find_library(FFTW_LIBRARIES NAMES ${libfft} PATHS ${LIB_PATHFFT} $ENV{FFTW_LIB} $ENV{FFTW_HOME} )
if(DEFINED ENV{FFTW_INCLUDE})
find_path(FFTW_PATH NAMES fftw3.h PATHS ${INC_PATHFFT} )
find_path(FFTW_INCLUDES NAMES fftw3.h PATHS ${INC_PATHFFT} )
else()
find_path(FFTW_PATH NAMES fftw3.h )
find_path(FFTW_INCLUDES NAMES fftw3.h )
endif()
if(FFTW_PATH AND FFTW_INCLUDES AND FFTW_LIBRARIES)
set(FFTW_FOUND TRUE)
endif(FFTW_PATH AND FFTW_INCLUDES AND FFTW_LIBRARIES)
if (FFTW_FOUND)
message(STATUS "Found FFTW: ${libfft}")
message(STATUS "FFTW_LIBRARIES: ${FFTW_LIBRARIES}")
else(FFTW_FOUND)
if(DoublePrec_CPU)
message(STATUS "Double-precision FFTW was NOT found")
else(DoublePrec_CPU)
message(STATUS "Single-precision FFTW was NOT found")
endif(DoublePrec_CPU)
endif(FFTW_FOUND)
if(FFTW_FIND_REQUIRED AND NOT FFTW_FOUND)
message( FATAL_ERROR "FFTW is required." )
endif(FFTW_FIND_REQUIRED AND NOT FFTW_FOUND)
int main()
{
#if defined (__i386__) || defined (__x86_64__) || defined (_M_IX86) || defined (_M_X64)
return 0;
#else
#error This is not x86
#endif
}
diff -r -u fltk-1.3.3-orig/src/fl_line_style.cxx fltk-1.3.3/src/fl_line_style.cxx
--- fltk-1.3.3-orig/src/fl_line_style.cxx 2012-03-18 19:48:29.000000000 +0100
+++ fltk-1.3.3/src/fl_line_style.cxx 2016-05-05 19:35:55.000000000 +0200
@@ -35,8 +35,8 @@
#ifdef __APPLE_QUARTZ__
float fl_quartz_line_width_ = 1.0f;
-static enum CGLineCap fl_quartz_line_cap_ = kCGLineCapButt;
-static enum CGLineJoin fl_quartz_line_join_ = kCGLineJoinMiter;
+static CGLineCap fl_quartz_line_cap_ = kCGLineCapButt;
+static CGLineJoin fl_quartz_line_join_ = kCGLineJoinMiter;
static CGFloat *fl_quartz_line_pattern = 0;
static int fl_quartz_line_pattern_size = 0;
void fl_quartz_restore_line_style_() {
@@ -110,9 +110,9 @@
DeleteObject(fl_current_xmap->pen);
fl_current_xmap->pen = newpen;
#elif defined(__APPLE_QUARTZ__)
- static enum CGLineCap Cap[4] = { kCGLineCapButt, kCGLineCapButt,
+ static CGLineCap Cap[4] = { kCGLineCapButt, kCGLineCapButt,
kCGLineCapRound, kCGLineCapSquare };
- static enum CGLineJoin Join[4] = { kCGLineJoinMiter, kCGLineJoinMiter,
+ static CGLineJoin Join[4] = { kCGLineJoinMiter, kCGLineJoinMiter,
kCGLineJoinRound, kCGLineJoinBevel };
if (width<1) width = 1;
fl_quartz_line_width_ = (float)width;
#! /bin/sh
# Wrapper for compilers which do not understand `-c -o'.
scriptversion=2009-10-06.20; # UTC
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software
# Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand `-c -o'.
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file `INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
esac
ofile=
cfile=
eat=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as `compile cc -o foo foo.c'.
# So we strip `-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no `-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# `.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use `[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End: