When I run the provided examples, I can successfully output dump files, but I would like to visualize the simulation in Paraview. When I use custom/vtk to output vtk files, I get the above error message. I recently installed VTK and turned USE_VTK to "ON" in the Makefile.User. Has anyone else had this problem/how did you resolve it?
Thanks,
Jackson
mschramm | Wed, 10/04/2017 - 15:07
check your installation's help
Check your liggghts installation's help
${my_liggghts} -help
near the bottom you should see * Dump Styles
Here you should see custom, mesh/stl, xyz, ...
If you do not see custom/vtk then your liggghts was compiled without that option enabled.
If this is the case, try re-installing liggghts.
jshan432 | Wed, 10/04/2017 - 15:48
Hi mschramm,
Hi mschramm,
Thank you very much for replying. I can't seem to find the liggghts installation help file. Where specifically should that be located?
Thanks,
Jackson
mschramm | Wed, 10/04/2017 - 18:28
LIGGGHTS help
-help is a command that you use with the liggghts program.
How do you normally run a liggghts' script?
Say you normally do this using
LIGGGHTS < my_input.liggghts
This would run liggghts and give it the input script my_input.liggghts
to get the help menu you would use the following
LIGGGHTS -help
Worse come to worse.
navigate to your build directory where lmp_auto is (Im assuming you are running 3.7.x and made the program using make auto)
run the command
./lmp_auto -help
jshan432 | Wed, 10/04/2017 - 18:46
mschramm,
mschramm,
Thank you for the explanation. I've never used the LIGGGHTS command before. I usually run a script using "./lmp_auto -echo both < in.chute_wear" for example when I am in the the folder containing lmp_auto and the desired script.
Your ./lmp_auto-help tip did the trick, and you were right, theres no custom/vtk listed as a dump style. You think reinstalling liggghts will fix this?
Thanks again,
Jackson
medvedeg | Thu, 10/05/2017 - 12:50
Hi Jackson,
Hi Jackson,
not re-install, but re-compile :)
Please try clean compilation: "make clean-all && make auto -j 4". Check for possible error messages. You can type "./lmp_auto" to check the date and time when the code was compiled for the last time
jshan432 | Thu, 10/05/2017 - 14:47
Hi Alexander,
Hi Alexander,
Thank you very much your help, but that did not work either. After running "make clean-all && make auto -j 4" and "./lmp_auto -help", custom/vtk is still not listed as an available dump style. Is there anything else you know of that I can try?
Thanks,
Jackson
medvedeg | Thu, 10/05/2017 - 16:18
Hi Jackson,
Hi Jackson,
could you please provide us with
1) your Makefile.auto and Makefile.user
2) Compilation log file.
Thank you
jshan432 | Thu, 10/05/2017 - 17:28
Alexander,
Alexander,
Sure thing. I didn't know if there was a way to upload files so I copied the text below. If there's a more convenient way for me to give you the files I am happy to do it.
Thanks again for your help,
Jackson
Makefile.User:
# MPI: "ON" or "OFF"
# Description: Use the message passing interface for parallel execution
USE_MPI = "ON”
# CATALYST: "ON" or "OFF"
# Description: Allow the use of in-situ visualization using ParaView
USE_CATALYST = "OFF"
# VTK: "ON" or "OFF"
# Description: Allow the use of VTK output that can be read directly with ParaView
USE_VTK = "ON”
# SUPERQUADRICS: "ON" or "OFF"
# Description: Enable superquadric particles (Note: requires boost)
USE_SUPERQUADRICS = "OFF"
# JPG: "ON" or "OFF"
# Description: Allow the output of jpg files of the simulation (only sphere rendering available)
USE_JPG = "OFF"
# FPIC: "ON" or "OFF"
# Description: Generate position independent code
USE_FPIC = "ON"
# DEBUG:
# "OFF" : optimized code for production (-O2 optimization, no -g)
# "ON" : optimized debug mode (-Og and -g)
# "NOOPT" : non-optimized debug mode (-O0 and -g)
USE_DEBUG = "OFF"
# PROFILE:
# "OFF" : no profiling code generated
# "ON" : profiling code generated (-pg)
USE_PROFILE = "OFF"
# CONVEX: "ON" or "OFF"
# Decription: Enable polyhedral particles (premium only)
USE_CONVEX = "OFF"
# If you want to use the polyhedral particles feature and did not install libccd yourself
# then set the following to "ON" and uncomment it to allow for an automatic download and compilation
#AUTOINSTALL_CONVEX = "OFF"
# GZIP: "ON" or "OFF"
# Description: Some output and input is zipped to reduce file sizes
USE_GZIP = "OFF"
# XDR: "ON" or "OFF"
# Description: Allows dumping of particles in XTC format. This is only necessary if the platform does not have its own XDR files available.
USE_XDR = "OFF"
################################################################################################
#
# ADVANCED SETTINGS
#
# Set and uncomment the variables in the following for a more fine grained control.
#
# WARNING:
# All variables that follow are overridden if their corresponding non-"_USR" variables are set.
# E.g. if MPICXX is set, then setting MPICXX_USR will have no effect.
#
################################################################################################
# MPI specific variables
#
# MPI compiler
#MPICXX_USR=/path/to/mpicxx
# Path that contains the includes (mpi.h)
# Warning: this is the only *_INC_USR that does not use -I
#MPI_INC_USR=/path/to/mpi/include
# Path that contains the MPI libraries
# Warning: this is the only *_LIB_USR that does not use -L
#MPI_LIB_USR=/path/to/mpi/lib
# Additional MPI libraries
#MPI_ADDLIBS_USR=-lmpi
# Additional MPI flags for compilation
#MPI_CCFLAGS_USR=-funroll-loops -fstrict-aliasing -Wall -Wno-unused-result
# Additional MPI flags for linking
#MPI_LDFLAGS_USR=-lstdc++
# Additional MPI flags for dependency generation
#MPI_DEPFLAGS_USR=-M
#
# C++ Compiler specific variables (only required if USE_MPI is "OFF")
#
# C++ compiler
#CXX_USR=/usr/bin/g++
# Additional flags for compilation
#CCFLAGS_USR=-funroll-loops -fstrict-aliasing -Wall -Wno-unused-result
# Additional flags for linking
#LDFLAGS_USR=-lstdc++
# Additional flags for dependency generation
#DEPFLAGS_USR=-M
# Library compilation variables
#
# Static library flags
#ARCHIVE_USR=ar
#ARFLAGS_USR=-rcsv
#
# Shared library flags
#SHLIBFLAGS_USR=-shared
# Size executable
#SIZE_USR=size
# Catalyst specific variables
#
# Path in which ParaView was built (should contain ParaViewConfig.cmake)
#PV_BUILD_DIR_USR=/path/to/paraview-build
# VTK specific variables
#
# Path that contains the includes (vtkVersion.h)
#VTK_INC_USR=-I/usr/local/include/vtk-8.1
# Path that contains the VTK libraries
#VTK_LIB_USR=-L/usr/local/include/vtk-8.1
# Additional VTK libraries to include
#VTK_ADDLIBS_USR=
# Appendix to the library names
# In general this is going to be dependent on the version of VTK that you have
# installed. In this case it is going to be detected automatically. In case of
# using a VTK version from a ParaView compilation, the appendix will be equal
# to pv-X.Y where X.Y is the ParaView version.
#VTK_APPENDIX_USR=pv-5.3
# SUPERQUADRICS specific variables
#
# Boost include path
#BOOST_INC_USR=-I/path/to/boost/include
# JPG specific variables
#
# Path that contains the includes (libjpeg.h)
#JPG_INC_USR=-I/path/to/jpeg/include
# Path that contains the JPG libraries
#JPG_LIB_USR=-L/path/to/jpeg/lib
# Additional JPG libraries to include (-ljpeg added by default)
#JPG_ADDLIBS_USR=
# CONVEX specific variables
#
# Path that contains the includes (ccd/ccd.h)
#CONVEX_INC_USR=-I/path/to/libccd/include
# Path that contains the CONVEX libraries
#CONVEX_LIB_USR=-L/path/to/libccd/lib
# Additional CONVEX libraries to include (-lccd added by default)
#CONVEX_ADDLIBS_USR=
# LIGGGHTS pre-processor flags
# Note: Most of these flags can be set by one of the USE_* variables at the top of this file
#LMP_INC=
# Version of Makefile.user (do not delete the following line)
MAKEFILE_USER_VERSION = "1.1"
Makefile.auto (below): ____________________________________________________________________________________________________________________________
# auto = Recommended automatic makefile (settings in MAKE/Makefile.user or MAKE/Makefile.user_${postfix})
#
# Attempts to detect MPI, VTK, etc. automatically
#
# WARNING:
# This file should NOT be modified by the user. Instead see the Makefile.user file in the present
# directory of this file and set your variables there. Should this file not exist, simply run
# $ make auto
# once and it will be created for you including default values.
#
# Should you have any issues with this makefile please send us a bug report on www.cfdem.com so
# that we can improve it.
# Subtargets
EMPTY=
SUBTARGET=
ifneq (${postfix}, ${EMPTY})
SUBTARGET = _${postfix}
endif
TMP := $(shell ls ../MAKE/Makefile.user${SUBTARGET} 2> /dev/null 1> /dev/null && echo 1 || echo 0)
ifeq ($(TMP), 0)
# Use default Makefile.user
ifeq (${postfix}, ${EMPTY})
TMP := $(shell tail -n +11 ../MAKE/Makefile.user_default > ../MAKE/Makefile.user || echo -1)
# Use Makefile.user_${postfix}
else
# Check if Makefile.user exists, if yes clone this one, otherwise Makefile.user_default
TMP := $(shell ls ../MAKE/Makefile.user 2> /dev/null 1> /dev/null && echo 1 || echo 0)
ifneq ($(TMP), 0)
TMP := $(shell tail -n +11 ../MAKE/Makefile.user > ../MAKE/Makefile.user${SUBTARGET} || echo -1)
else
TMP := $(shell tail -n +11 ../MAKE/Makefile.user_default > ../MAKE/Makefile.user${SUBTARGET} || echo -1)
endif
endif
ifeq ($(TMP), -1)
$(error Could not create Makefile.user${SUBTARGET})
else
$(info )
$(info >>> WARNING <<<)
$(info Created MAKE/Makefile.user${SUBTARGET} for the first time. Please check that the options in that file are set correctly.)
$(info )
endif
endif
sinclude ../MAKE/Makefile.user${SUBTARGET}
# Version consistency check
# The following line needs to be identical in Makefile.user_default
MAKEFILE_USER_DEFAULT_VERSION = "1.1"
ifeq ($(origin MAKEFILE_USER_VERSION), undefined)
$(info Could not find MAKEFILE_USER_VERSION in MAKE/Makefile.user${SUBTARGET}. No version consistency check will be performed and there might be errors. Please remove [backup] this file and run "make auto" again to generate a new one.)
else
ifneq ($(MAKEFILE_USER_VERSION), $(MAKEFILE_USER_DEFAULT_VERSION))
$(info $(MAKEFILE_USER_VERSION) $(MAKEFILE_USER_DEFAULT_VERSION))
$(error Makefile.auto has detected an outdated MAKE/Makefile.user${SUBTARGET}. Please remove [backup] this file and run "make auto" again to generate a new one.)
endif
endif
# OS detection
ifeq ($(OS),Windows_NT)
MINGW := 1
else
MINGW := 0
endif
ECHO := echo
TMPFILE = /tmp/liggghtscompile.tmp
TMP = $(shell $(ECHO) "\n" > $(TMPFILE) && cat $(TMPFILE))
EMPTY =
ifneq ($(TMP), $(EMPTY))
ECHO := $(ECHO) -e
TMP = $(shell $(ECHO) "\n" > $(TMPFILE) && cat $(TMPFILE))
ifneq ($(TMP), $(EMPTY))
$(error Could not create empty file with \n entry using echo and echo -e)
endif
endif
# Default settings should ../Makefile.user${SUBTARGET} not exist for some reason or not contain the minimum
# variables
USE_MPI ?= "ON"
USE_VTK ?= "ON"
USE_SUPERQUADRICS ?= "OFF"
USE_CATALYST ?= "OFF"
USE_JPG ?= "OFF"
USE_FPIC ?= "ON"
USE_DEBUG ?= "OFF"
USE_PROFILE ?= "OFF"
USE_CONVEX ?= "OFF"
USE_GZIP ?= "OFF"
USE_XDR ?= "OFF"
AUTOINSTALL_CONVEX ?= "OFF"
# Default variables
ifeq ($(MINGW), 0)
# for Linux
MPI_CCFLAGS_USR ?=-funroll-loops -fstrict-aliasing -Wall -Wno-unused-result
MPI_LDFLAGS_USR ?=-lstdc++
MPI_DEPFLAGS_USR ?=-M
CCFLAGS_USR ?=-funroll-loops -fstrict-aliasing -Wall -Wno-unused-result
LDFLAGS_USR ?=-lstdc++
DEPFLAGS_USR ?=-M
ARCHIVE_USR ?= ar
ARFLAGS_USR ?= -rcsv
SHLIBFLAGS_USR ?= -shared
SIZE_USR ?= size
else
# for Windows
ifeq ($(USE_VTK), "ON") # disable VTK
USE_VTK = "OFF"
$(info Warning: VTK has been disabled due to compilation on Windows)
endif
ifeq ($(USE_SUPERQUADRICS), "ON") # disable SUPERQUADRICS
USE_SUPERQUADRICS = "OFF"
$(info Warning: SUPERQUADRICS has been disabled due to compilation on Windows)
endif
ifeq ($(USE_CATALYST), "ON") # disable CATALYST
USE_CATALYST = "OFF"
$(info Warning: VTK has been disabled due to compilation on Windows)
endif
ifeq ($(USE_MPI), "ON") # disable MPI
USE_MPI = "OFF"
$(info Warning: MPI has been disabled due to compilation on Windows)
endif
ifeq ($(USE_JPG), "ON") # disable JPG
USE_JPG = "OFF"
$(info Warning: JPG has been disabled due to compilation on Windows)
endif
ifeq ($(USE_CONVEX), "ON") # disable CONVEX
USE_CONVEX = "OFF"
$(info Warning: CONVEX has been disabled due to compilation on Windows)
endif
ifeq ($(USE_DEBUG), "ON") # disable DEBUG
USE_DEBUG = "OFF"
$(info Warning: DEBUG has been disabled due to compilation on Windows)
endif
ifeq ($(USE_PROFILE), "ON") # disable PROFILE
USE_PROFILE = "OFF"
$(info Warning: DEBUG has been disabled due to compilation on Windows)
endif
ifeq ($(USE_GZIP), "ON") # disable GZIP
USE_GZIP = "OFF"
$(info Warning: GZIP has been disabled due to compilation on Windows)
endif
ifeq ($(USE_XDR), "OFF") # enable XDR
USE_XDR = "ON"
$(info Warning: XDR has been enabled due to compilation on Windows)
endif
CCFLAGS_USR ?=-I../STUBS -O3 -march=i686 -mtune=generic -mfpmath=387 -mpc64 -fno-exceptions -fno-rtti -ffast-math -funroll-loops -fstrict-aliasing -Wall -W -Wno-uninitialized
LDFLAGS_USR ?=-O -lwsock32
DEPFLAGS_USR ?=-M
ARCHIVE_USR ?= ar
ARFLAGS_USR ?= -rcsv
SHLIBFLAGS_USR ?=
SIZE_USR ?= i686-pc-mingw32-size
OBJ += mpi.o
endif
ifeq ($(USE_CATALYST), "ON")
ifneq ($(USE_VTK), "ON")
USE_VTK = "ON"
$(info Information: USE_VTK was not activated but USE_CATALYST overrode this setting)
endif
endif
# Read previously used variables
OPTIONS_FILE=../MAKE/Makefile.auto.options${SUBTARGET}
sinclude $(OPTIONS_FILE)
# Set them to be equal the current variables if they have not been set
OPTIONS_USE_MPI ?= $(USE_MPI)
OPTIONS_USE_VTK ?= $(USE_VTK)
OPTIONS_USE_SUPERQUADRICS ?= $(USE_SUPERQUADRICS)
OPTIONS_USE_CATALYST ?= $(USE_CATALYST)
OPTIONS_USE_JPG ?= $(USE_JPG)
OPTIONS_USE_FPIC ?= $(USE_FPIC)
OPTIONS_USE_DEBUG ?= $(USE_DEBUG)
OPTIONS_USE_PROFILE ?= $(USE_PROFILE)
OPTIONS_USE_CONVEX ?= $(USE_CONVEX)
OPTIONS_USE_GZIP ?= $(USE_GZIP)
OPTIONS_USE_XDR ?= $(USE_XDR)
# Check if they have changed
ifneq ($(OPTIONS_USE_MPI), $(USE_MPI))
$(error variable USE_MPI has changed. Please run "make clean-all" or "make clean-auto" before compiling again.)
endif
ifneq ($(OPTIONS_USE_VTK), $(USE_VTK))
$(error variable USE_VTK has changed. Please run "make clean-all" or "make clean-auto" before compiling again.)
endif
ifneq ($(OPTIONS_USE_SUPERQUADRICS), $(USE_SUPERQUADRICS))
$(error variable USE_SUPERQUADRICS has changed. Please run "make clean-all" or "make clean-auto" before compiling again.)
endif
ifneq ($(OPTIONS_USE_CATALYST), $(USE_CATALYST))
$(error variable USE_CATALYST has changed. Please run "make clean-all" or "make clean-auto" before compiling again.)
endif
ifneq ($(OPTIONS_USE_JPG), $(USE_JPG))
$(error variable USE_JPG has changed. Please run "make clean-all" or "make clean-auto" before compiling again.)
endif
ifneq ($(OPTIONS_USE_FPIC), $(USE_FPIC))
$(error variable USE_FPIC has changed. Please run "make clean-all" or "make clean-auto" before compiling again.)
endif
ifneq ($(OPTIONS_USE_DEBUG), $(USE_DEBUG))
$(error variable USE_DEBUG has changed. Please run "make clean-all" or "make clean-auto" before compiling again.)
endif
ifneq ($(OPTIONS_USE_PROFILE), $(USE_PROFILE))
$(error variable USE_PROFILE has changed. Please run "make clean-all" or "make clean-auto" before compiling again.)
endif
ifneq ($(OPTIONS_USE_CONVEX), $(USE_CONVEX))
$(error variable USE_CONVEX has changed. Please run "make clean-all" or "make clean-auto" before compiling again.)
endif
ifneq ($(OPTIONS_USE_GZIP), $(USE_GZIP))
$(error variable USE_GZIP has changed. Please run "make clean-all" or "make clean-auto" before compiling again.)
endif
ifneq ($(OPTIONS_USE_XDR), $(USE_XDR))
$(error variable USE_XDR has changed. Please run "make clean-all" or "make clean-auto" before compiling again.)
endif
# Write out current variables
$(shell echo '# Automatically generated file from Makefile.auto.\n' > $(OPTIONS_FILE))
$(shell echo '# DO NO EDIT THIS FILE\n' >> $(OPTIONS_FILE))
$(shell echo 'OPTIONS_USE_MPI = $(USE_MPI)' >> $(OPTIONS_FILE))
$(shell echo 'OPTIONS_USE_VTK = $(USE_VTK)' >> $(OPTIONS_FILE))
$(shell echo 'OPTIONS_USE_SUPERQUADRICS = $(USE_SUPERQUADRICS)' >> $(OPTIONS_FILE))
$(shell echo 'OPTIONS_USE_CATALYST = $(USE_CATALYST)' >> $(OPTIONS_FILE))
$(shell echo 'OPTIONS_USE_JPG = $(USE_JPG)' >> $(OPTIONS_FILE))
$(shell echo 'OPTIONS_USE_FPIC = $(USE_FPIC)' >> $(OPTIONS_FILE))
$(shell echo 'OPTIONS_USE_PROFILE = $(USE_PROFILE)' >> $(OPTIONS_FILE))
$(shell echo 'OPTIONS_USE_CONVEX = $(USE_CONVEX)' >> $(OPTIONS_FILE))
$(shell echo 'OPTIONS_USE_GZIP = $(USE_GZIP)' >> $(OPTIONS_FILE))
$(shell echo 'OPTIONS_USE_XDR = $(USE_XDR)' >> $(OPTIONS_FILE))
# Sources
LIBCCD_GIT ?= https://github.com/danfis/libccd.git
LIBCCD_ZIP ?= https://github.com/danfis/libccd/archive/master.zip
# Lib path in which 3rd party libraries are installed
LIB_PATH ?= ../../lib
# Initialization of EXTRA_* variables
# All -I include paths
EXTRA_INC=
# All -L library paths
EXTRA_LIB=
# All -l libraries
EXTRA_ADDLIBS=
# Debug settings
#
ifeq ($(USE_DEBUG), "ON")
OPT_LVL = -Og -g
LMP_INC += -DLIGGGHTS_DEBUG
else
ifeq ($(USE_DEBUG), "NOOPT")
OPT_LVL = -O0 -g
LMP_INC += -DLIGGGHTS_DEBUG
else
ifeq ($(USE_DEBUG), "OFF")
ifeq ($(MINGW), 0)
OPT_LVL = -O2
else
OPT_LVL = # for mingw the optimization is already set in CCFLAGS_USR
endif
else
$(error 'USE_DEBUG needs to be either "ON", "NOOPT" or "OFF"')
endif
endif
endif
# Profiling settings
#
ifeq ($(USE_PROFILE), "ON")
PROF_FLAG = -pg
else
PROF_FLAG =
endif
# MPI settings
#
ifeq ($(USE_MPI), "ON")
# Test if MPICXX is set and if yes, then check if this executable exists
ifneq (, $(MPICXX))
ifeq (, $(shell which $(MPICXX)))
$(error "Could not find executable set in variable MPICXX")
endif
# MPICXX is not set
else
# Check if MPICXX_USR is set
ifneq (, $(MPICXX_USR))
ifeq (, $(shell which $(MPICXX_USR)))
$(error "Could not find executable set in MPICXX_USR")
else
# found it, so set MPICXX accordingly
MPICXX = $(MPICXX_USR)
endif
# if MPICXX_USR is not set then try to find mpicxx or mpic++
else
ifeq (, $(shell which mpicxx))
ifeq (, $(shell which mpic++))
$(error 'Could not find a suitable mpi compiler (mpicxx or mpic++). Please specify one in the Makefile.user${SUBTARGET} using the MPICXX_USR variable or set USE_MPI to "OFF"')
else
MPICXX = mpic++
endif
else
MPICXX = mpicxx
endif
endif
endif
# Detect openmpi mvapich mpich2 etc.
ifneq ($(origin MPI_INC_USR), undefined)
MPI_INC ?= $(MPI_INC_USR)
endif
TMP_INC =
ifneq ($(origin MPI_INC), undefined)
TMP_INC = -I$(MPI_INC)
endif
# We assume that the compiler supports #pragma message
TMP := $(shell $(ECHO) '\#include \n \#if defined(MPICH) \n \#pragma message "MPICH" \n \#elif defined(OPEN_MPI) \n \#pragma message "OpenMPI" \n \#else \n \#pragma message "Unknown" \n \#endif' > $(TMPFILE) && $(MPICXX) $(OPT_LVL) $(PROF_FLAG) $(TMP_INC) -xc++ -E $(TMPFILE) 2> /dev/null | grep pragma | grep -m 1 message || echo -1)
# See if compilation has worked out
ifeq ($(TMP), -1)
# Maybe it failed because of the optimization as -Og is not known
ifeq ($(USE_DEBUG), "ON")
TMP := $(shell $(ECHO) '\#include \n \#if defined(MPICH) \n \#pragma message "MPICH" \n \#elif defined(OPEN_MPI) \n \#pragma message "OpenMPI" \n \#else \n \#pragma message "Unknown" \n \#endif' > $(TMPFILE) && $(MPICXX) -O0 -g $(PROF_FLAG) $(TMP_INC) -xc++ -E $(TMPFILE) 2> /dev/null | grep pragma | grep -m 1 message || echo -1)
ifeq ($(TMP), -1)
$(error 'Could not compile a simple MPI example (testing with -Og and -O0). Test was done with MPI_INC="$(TMP_INC)" and MPICXX="$(MPICXX)"')
else
OPT_LVL = -O0 -g
$(info 'Could not use -Og compilation flag, replacing with -O0')
endif
else
$(error 'Could not compile a simple MPI example. Test was done with MPI_INC="$(TMP_INC)" and MPICXX="$(MPICXX)"')
endif
endif
MPI_TYPE := $(word $(words $(TMP)), $(TMP))
ifeq ($(MPI_TYPE), MPICH)
ifneq ($(origin MPI_ADDLIBS), undefined)
MPI_ADDLIBS += -lmpich -lmpichcxx
else
ifneq ($(origin MPI_ADDLIBS_USR), undefined)
MPI_ADDLIBS_USR += -lmpich -lmpichcxx
else
MPI_ADDLIBS = -lmpich -lmpichcxx
endif
endif
else
ifeq ($(MPI_TYPE), OpenMPI)
# Here we could do some OpenMPI related stuff
endif
endif
# Now that we have found an mpi compiler check that we can actually do something with it
# 0.) Prepare the environment
ifneq ($(origin MPI_LIB_USR), undefined)
MPI_LIB ?= $(MPI_LIB_USR)
endif
MPI_ADDLIBS ?= $(MPI_ADDLIBS_USR)
MPI_CCFLAGS ?= $(MPI_CCFLAGS_USR)
MPI_LDFLAGS ?= $(MPI_LDFLAGS_USR)
MPI_CCFLAGS += $(OPT_LVL) $(PROF_FLAG)
MPI_LDFLAGS += $(OPT_LVL) $(PROF_FLAG)
# Linking test
TMP := $(shell $(ECHO) 'main(){}' > $(TMPFILE) && $(MPICXX) -xc++ $(MPI_LDFLAGS) -L$(MPI_LIB) $(MPI_ADDLIBS) -o /dev/null $(TMPFILE) 2> /dev/null && echo 0 || echo -1)
ifeq ($(TMP), -1)
$(error 'Could not compile and link a simple MPI example. Test was done with MPI_LIB=$(MPI_LIB)')
endif
# Finally set the compiler environment
CXX = $(MPICXX)
CCFLAGS = $(MPI_CCFLAGS)
LDFLAGS = $(MPI_LDFLAGS)
DEPFLAGS ?= $(MPI_DEPFLAGS_USR)
ifneq ($(origin MPI_INC), undefined)
EXTRA_INC += -I$(MPI_INC)
endif
ifneq ($(origin MPI_LIB), undefined)
EXTRA_LIB += -L$(MPI_LIB)
endif
EXTRA_ADDLIBS += $(MPI_ADDLIBS)
# If USE_MPI is not set, check that we have a C++ compiler available
else
# Test if MPICXX is set and if yes, then check if this executable exists
ifneq (, $(CXX))
ifeq (, $(shell which $(CXX)))
$(error "Could not find executable set in variable CXX")
endif
# CXX is not set
else
# Check if CXX_USR is set
ifneq (, $(CXX_USR))
ifeq (, $(shell which $(CXX_USR)))
$(error "Could not find executable set in CXX_USR")
else
# found it, so set MPICXX accordingly
CXX = $(CXX_USR)
endif
else
# if CXX is not set then try to find g++ on linux
ifeq ($(MINGW), 0)
ifeq (, $(shell which g++))
$(error 'Could not find a suitable c++ compiler (g++). Please specify one in the Makefile.user${SUBTARGET} using the CXX_USR variable')
else
CXX = g++
endif
else # or the appropriate mingw compiler
ifeq (, $(shell which i686-pc-mingw32-g++))
$(error 'Could not find a suitable c++ compiler (i686-pc-mingw32-g++). Please specify one in the Makefile.user${SUBTARGET} using the CXX_USR variable')
else
CXX = i686-pc-mingw32-g++
endif
endif
endif
endif
# Now that we have found a c++ compiler check that we can actually do something with it
# 0.) Prepare the environment
CCFLAGS ?= $(CCFLAGS_USR)
LDFLAGS ?= $(LDFLAGS_USR)
DEPFLAGS ?= $(DEPFLAGS_USR)
CCFLAGS += $(OPT_LVL)
LDFLAGS += $(OPT_LVL)
EXTRA_INC += -I../STUBS
EXTRA_LIB += -L../STUBS
EXTRA_ADDLIBS += -lmpi_stubs
# 1.) Attempt compilation
TMP := $(shell $(ECHO) '\#include \n main(){}' > $(TMPFILE) && $(CXX) $(EXTRA_INC) $(EXTRA_LIB) $(EXTRA_ADDLIBS) -xc++ $(LDFLAGS) $(CCFLAGS) -o /dev/null $(TMPFILE) 2> /dev/null && echo 0 || echo -1)
ifeq ($(TMP), -1)
$(error 'Could not compile a simple c++ example. Please make sure that you have run "make stubs" before compiling LIGGGHTS itself. Test was done with CXX=$(CXX), EXTRA_INC=$(EXTRA_INC), EXTRA_LIB=$(EXTRA_LIB) and EXTRA_ADDLIBS=$(EXTRA_ADDLIBS).')
endif
endif
# Check for c++11 support
C11SUPPORT = 0
TMP := $(shell $(ECHO) 'main(){}' > $(TMPFILE) && $(CXX) $(EXTRA_INC) $(EXTRA_LIB) $(EXTRA_ADDLIBS) -xc++ $(LDFLAGS) $(CCFLAGS) -std=c++11 -o /dev/null $(TMPFILE) 2> /dev/null && echo 0 || echo -1)
ifeq ($(TMP),0)
C11SUPPORT = 1
endif
# Position independent code
#
ifeq ($(USE_FPIC), "ON")
SHFLAGS = -fPIC
CCFLAGS += -fPIC
else
ifeq ($(USE_FPIC), "OFF")
SHFLAGS =
else
$(error 'USE_FPIC needs to be either "ON" or "OFF"')
endif
endif
# Check for gzip
#
ifeq ($(USE_GZIP), "ON")
ifneq (, $(shell which gzip))
LMP_INC += -DLAMMPS_GZIP
else
$(error 'USE_GZIP is set to "ON" but the gzip executable cannot be found. Ensure that it is available in your PATH variable or set USE_GZIP to "OFF"')
endif
endif
ifeq ($(USE_XDR), "ON")
LMP_INC += -DLAMMPS_XDR
endif
# Default for building shared libraries
SHLIBFLAGS = -shared
# Library compilation flags
ARCHIVE ?= $(ARCHIVE_USR)
ARFLAGS ?= $(ARFLAGS_USR)
SHFLAGS ?= $(SHFLAGS_USR)
SHLIBFLAGS ?= $(SHLIBFLAGS_USR)
# Size
SIZE ?= $(SIZE_USR)
# Linker (for now equal to CXX) if not set explicitly
LINK ?= $(CXX)
# CATALYST for in-situ ParaView visualization
#
ifeq ($(USE_CATALYST), "ON")
TMP := $(shell cp ../MAKE/CMakeLists_Catalyst.txt CMakeLists.txt && mkdir -p .tmp_catalyst_build && cd .tmp_catalyst_build && cd - && echo 0 || echo -1)
ifeq ($(TMP), -1)
$(error 'Could not create .tmp_catalyst_build and create CMakeLists.txt')
endif
# All vtk includes in LIGGGHTS (to be inserted into catalyst_dummy.cpp)
#grep -rh "#include" *{h,cpp} | grep " /dev/null && cd - && echo 0 || echo -1)
TMP2 := $(shell rm -rf CMakeLists.txt CMakeCache.txt CMakeFiles)
ifeq ($(TMP), -1)
$(error 'Could not generate makefiles using cmake. Make sure PV_BUILD_DIR="$(PV_BUILD_DIR)" is set correctly')
endif
# TODO check if CXX_INCLUDES is set, if yes save it somewhere temporarily (same with other flags in flags.make)
sinclude .tmp_catalyst_build/CMakeFiles/CatalystAdaptor.dir/flags.make
CATALYST_INC = $(CXX_INCLUDES)
# Next the link_raw needs to remove the dummy crap and put this into the normal linking flags
CATALYST_LIB := $(shell cat .tmp_catalyst_build/CMakeFiles/CatalystDummy.dir/link.txt | sed s/.*libCatalystAdaptor.a// || echo -1)
ifeq ($(CATALYST_LIB), -1)
$(error 'Could not get linking flags from cmake files')
endif
# prepare the environment
ifneq ($(origin VTK_INC_USR), undefined)
$(info Information: VTK_INC_USR was set, but USE_CATALYST overrides this)
endif
ifneq ($(origin VTK_LIB_USR), undefined)
$(info Information: VTK_LIB_USR was set, but USE_CATALYST overrides this)
endif
VTK_INC_USR = $(CATALYST_INC)
VTK_LIB_USR = $(CATALYST_LIB)
# Set the USE_CATALYST_FLAG
LMP_INC += -DUSE_CATALYST_FLAG
endif
# VTK library, OPTIONAL
# INC = path for VTK header files
# LIB = path for VTK library
# ADDLIBS = name of VTK library
ifeq ($(USE_VTK), "ON")
# Use user settings if available
# The following ifneq are required as otherwise VTK_{INC,LIB} will be set (but are empty) if VTK_{INC,LIB}_USR is undefined. This will conflict with the following ?= assignments further below.
ifneq ($(origin VTK_INC_USR), undefined)
VTK_INC ?= $(VTK_INC_USR)
endif
ifneq ($(origin VTK_LIB_USR), undefined)
VTK_LIB ?= $(VTK_LIB_USR)
endif
VTK_ADDLIBS ?= $(VTK_ADDLIBS_USR)
VTK_INC ?= -I$(shell ls -d /usr/include/vtk* 2> /dev/null | tail -n 1)
ifeq ($(VTK_INC),-I)
VTK_INC =
endif
# note we assume here that our compiler supports #pragma message
VTK_TMP := $(shell $(ECHO) '\#include \n \#define XSTR(x) STR(x) \n \#define STR(x) \#x \n \#pragma message XSTR(VTK_MAJOR_VERSION)' > $(TMPFILE) && $(CXX) -Wno-deprecated -E $(VTK_INC) -xc++ $(TMPFILE) 2> /dev/null | grep "pragma" | grep "message" || echo -1)
ifeq ($(VTK_TMP), -1)
$(error Could not obtain VTK_MAJOR_VERSION)
endif
VTK_MAJOR_VERSION := $(patsubst "%",%,$(word $(words $(VTK_TMP)),$(VTK_TMP)))
VTK_TMP := $(shell $(ECHO) '\#include \n \#define XSTR(x) STR(x) \n \#define STR(x) \#x \n \#pragma message XSTR(VTK_MINOR_VERSION)' > $(TMPFILE) && $(CXX) -Wno-deprecated -E $(VTK_INC) -xc++ $(TMPFILE) 2> /dev/null | grep "pragma" | grep "message" || echo -1)
ifeq ($(VTK_TMP), -1)
$(error Could not obtain VTK_MINOR_VERSION)
endif
VTK_MINOR_VERSION := $(patsubst "%",%,$(word $(words $(VTK_TMP)),$(VTK_TMP)))
VTK_VERSION=$(VTK_MAJOR_VERSION).$(VTK_MINOR_VERSION)
# check if the vtk compiled with ParaView is going to be used
USE_PV_VTK = "OFF"
ifeq ($(USE_CATALYST), "ON")
# VTK_LIB is set already
FILTER = $(foreach v,$(2),$(if $(findstring $(1),$(v)),$(v),))
ifeq ($(VTK_MAJOR_VERSION),5)
VTK_APPENDIX = $(strip $(call FILTER,libvtkCommon, $(VTK_LIB)))
else
ifneq (,$(filter $(VTK_MAJOR_VERSION),6 7 8))
VTK_APPENDIX = $(strip $(call FILTER,libvtkParallelMPI, $(VTK_LIB)))
else
$(error 'Unsupported VTK version $(VTK_VERSION)')
endif
endif
USE_PV_VTK = $(findstring -pv, $(VTK_APPENDIX))
ifeq ($(USE_PV_VTK), -pv)
USE_PV_VTK = "ON"
# strip the path, library name and ending
VTK_APPENDIX := $(subst libvtkParallelMPI-,,$(patsubst %.so,%,$(basename $(notdir $(VTK_APPENDIX)))))
VTK_LIB += -L$(PV_BUILD_DIR)/lib
endif
endif
ifeq ($(USE_PV_VTK), "OFF") # uses system vtk
ifeq ($(origin VTK_APPENDIX_USR), undefined)
VTK_APPENDIX = $(VTK_VERSION)
else
VTK_APPENDIX = $(VTK_APPENDIX_USR)
endif
endif
ifeq ($(VTK_MAJOR_VERSION),5)
ifneq ($(origin VTK_APPENDIX_USR), undefined)
VTK_APPENDIX_5 = -$(VTK_APPENDIX)
endif
ifeq ($(USE_PV_VTK), "ON")
VTK_APPENDIX_5 = -$(VTK_APPENDIX)
endif
VTK_LIB_SET = 0
ifneq ($(origin VTK_LIB), undefined)
VTK_LIB_SET = 1
else
VTK_LIB := -L$(dir $(shell find /usr/lib* -name 'libvtkCommon$(VTK_APPENDIX_5).so' | tail -n 1))
ifeq ($(VTK_LIB),-L)
VTK_LIB =
endif
endif
TMP := $(shell $(ECHO) '\#include \n main(){}' > $(TMPFILE) && $(CXX) $(EXTRA_LIB) $(VTK_LIB) $(VTK_INC) $(EXTRA_ADDLIBS) -lvtkCommon$(VTK_APPENDIX_5) $(CCFLAGS) -xc++ -o /dev/null $(TMPFILE) 2> /dev/null && echo 0 || echo -1)
ifeq ($(TMP), -1)
ifeq ($(VTK_LIB_SET), 0)
VTK_LIB := -L$(dir $(shell find /usr/lib* -name 'libvtkCommon.so' | tail -n 1))
ifeq ($(VTK_LIB),-L)
VTK_LIB =
endif
endif
TMP := $(shell $(ECHO) '\#include \n main(){}' > $(TMPFILE) && $(CXX) $(EXTRA_LIB) $(VTK_LIB) $(VTK_INC) $(EXTRA_ADDLIBS) -lvtkCommon $(CCFLAGS) -xc++ -o /dev/null $(TMPFILE) 2> /dev/null && echo 0 || echo -1)
ifeq ($(TMP), -1)
$(error 'Could not determine suitable appendix of VTK library with VTK_INC="$(VTK_INC)", VTK_LIB="$(VTK_LIB)" and VTK_APPENDIX="$(VTK_APPENDIX)"')
else
# everything worked, so no appendix needed
VTK_APPENDIX_5 = $(EMPTY)
endif
endif
VTK_ADDLIBS += -lvtkCommon$(VTK_APPENDIX_5) \
-lvtkFiltering$(VTK_APPENDIX_5) \
-lvtkIO$(VTK_APPENDIX_5) \
-lvtkParallel$(VTK_APPENDIX_5) \
-lvtkGraphics$(VTK_APPENDIX_5)
else
VTK_APPENDIX := -$(VTK_APPENDIX)
VTK_LIB_SET = 0
ifneq ($(origin VTK_LIB), undefined)
VTK_LIB_SET = 1
else
VTK_LIB := -L$(dir $(shell find /usr/lib* -name 'libvtkParallelMPI$(VTK_APPENDIX).so' 2> /dev/null | tail -n 1))
ifeq ($(VTK_LIB),-L)
VTK_LIB =
endif
endif
TMP := $(shell $(ECHO) '\#include \n main(){}' > $(TMPFILE) && $(CXX) $(EXTRA_LIB) $(VTK_LIB) $(VTK_INC) $(EXTRA_ADDLIBS) -lvtksys$(VTK_APPENDIX) $(CCFLAGS) -xc++ -o /dev/null $(TMPFILE) 2> /dev/null && echo 0 || echo -1)
ifeq ($(TMP), -1)
ifeq ($(VTK_LIB_SET), 0)
VTK_LIB := -L$(dir $(shell find /usr/lib* -name 'libvtkParallelMPI.so' 2> /dev/null | tail -n 1))
ifeq ($(VTK_LIB),-L)
VTK_LIB =
endif
endif
TMP := $(shell $(ECHO) '\#include \n main(){}' > $(TMPFILE) && $(CXX) $(EXTRA_LIB) $(VTK_LIB) $(VTK_INC) $(EXTRA_ADDLIBS) -lvtksys $(CCFLAGS) -xc++ -o /dev/null $(TMPFILE) 2> /dev/null && echo 0 || echo -1)
ifeq ($(TMP), -1)
$(error 'Could not determine suitable appendix of VTK library with VTK_INC="$(VTK_INC)", VTK_LIB="$(VTK_LIB)" and VTK_APPENDIX="$(VTK_APPENDIX)"')
else
# everything worked, so no appendix needed
VTK_APPENDIX = $(EMPTY)
endif
endif
VTKSET = 0
ifeq ($(VTK_MAJOR_VERSION),6)
VTKSET = 1
VTK_ADDLIBS += -lvtkCommonCore$(VTK_APPENDIX) \
-lvtkIOCore$(VTK_APPENDIX) \
-lvtkIOXML$(VTK_APPENDIX) \
-lvtkIOLegacy$(VTK_APPENDIX) \
-lvtkIOImage$(VTK_APPENDIX) \
-lvtkCommonDataModel$(VTK_APPENDIX) \
-lvtkParallelCore$(VTK_APPENDIX) \
-lvtkParallelMPI$(VTK_APPENDIX) \
-lvtkCommonExecutionModel$(VTK_APPENDIX) \
-lvtkFiltersCore$(VTK_APPENDIX) \
-lvtksys$(VTK_APPENDIX) \
-lvtkCommonMisc$(VTK_APPENDIX) \
-lvtkCommonTransforms$(VTK_APPENDIX) \
-lvtkCommonMath$(VTK_APPENDIX) \
-lvtkIOXMLParser$(VTK_APPENDIX) \
-lvtkCommonSystem$(VTK_APPENDIX) \
-lvtkDICOMParser$(VTK_APPENDIX) \
-lvtkmetaio$(VTK_APPENDIX)
# For VTK >= 6.2 we need to use lvtkIOParallelXML
MINOR_GE_2 := $(shell [ $(VTK_MINOR_VERSION) -ge 2 ] && echo true)
ifeq ($(MINOR_GE_2),true)
VTK_ADDLIBS += -lvtkIOParallelXML$(VTK_APPENDIX)
else
VTK_ADDLIBS += -lvtkIOParallel$(VTK_APPENDIX)
endif
ifeq ($(VTK_LIB_SET), 0)
VTK_LIB := -L$(dir $(shell find /usr/lib* -name 'libvtkParallelMPI$(VTK_APPENDIX).so' 2> /dev/null | tail -n 1))
ifeq ($(VTK_LIB),-L)
VTK_LIB =
endif
endif
endif
ifneq (, $(filter $(VTK_MAJOR_VERSION),7 8))
VTKSET = 1
VTK_ADDLIBS += -lvtkCommonCore$(VTK_APPENDIX) \
-lvtkIOCore$(VTK_APPENDIX) \
-lvtkIOXML$(VTK_APPENDIX) \
-lvtkIOLegacy$(VTK_APPENDIX) \
-lvtkIOImage$(VTK_APPENDIX) \
-lvtkCommonDataModel$(VTK_APPENDIX) \
-lvtkIOParallelXML$(VTK_APPENDIX) \
-lvtkParallelCore$(VTK_APPENDIX) \
-lvtkParallelMPI$(VTK_APPENDIX) \
-lvtkCommonExecutionModel$(VTK_APPENDIX) \
-lvtkFiltersCore$(VTK_APPENDIX) \
-lvtksys$(VTK_APPENDIX) \
-lvtkCommonMisc$(VTK_APPENDIX) \
-lvtkCommonTransforms$(VTK_APPENDIX) \
-lvtkCommonMath$(VTK_APPENDIX) \
-lvtkIOXMLParser$(VTK_APPENDIX) \
-lvtkCommonSystem$(VTK_APPENDIX) \
-lvtkDICOMParser$(VTK_APPENDIX) \
-lvtkmetaio$(VTK_APPENDIX)
ifeq ($(VTK_LIB_SET), 0)
VTK_LIB := -L$(dir $(shell find /usr/lib* -name 'libvtkParallelMPI$(VTK_APPENDIX).so' 2> /dev/null | tail -n 1))
ifeq ($(VTK_LIB),-L)
VTK_LIB =
endif
endif
ifeq ($(VTK_MAJOR_VERSION),8)
ifeq ($(C11SUPPORT),1)
CCFLAGS += -std=c++11
else
$(error VTK version $(VTK_VERSION) requires support for -std=c++11 in the compiler flags)
endif
endif
endif
ifeq ($(VTKSET),0)
TMP:=$(error Unsupported VTK version $(VTK_VERSION))
endif
endif
# Test the settings
TMP := $(shell $(ECHO) '\#include \n main(){}' > $(TMPFILE) && $(CXX) $(EXTRA_LIB) $(VTK_LIB) $(VTK_INC) $(EXTRA_ADDLIBS) $(VTK_ADDLIBS) $(CCFLAGS) -xc++ -o /dev/null $(TMPFILE) 2> /dev/null && echo 0 || echo -1)
ifeq ($(TMP), -1)
$(error 'Could not compile VTK example with VTK_INC="$(VTK_INC)", VTK_LIB="$(VTK_LIB)" and VTK_ADDLIBS="$(VTK_ADDLIBS)"')
endif
# Prepare environment
LMP_INC += -DLAMMPS_VTK
EXTRA_ADDLIBS += $(VTK_ADDLIBS)
EXTRA_LIB += $(VTK_LIB)
EXTRA_INC += $(VTK_INC)
# Write out VTK Data so that it can be used by CFDEMcoupling without detecting it again
$(shell echo 'OPTIONS_VTK_ADDLIBS = $(VTK_ADDLIBS)' >> $(OPTIONS_FILE))
$(shell echo 'OPTIONS_VTK_LIB = $(VTK_LIB)' >> $(OPTIONS_FILE))
$(shell echo 'OPTIONS_VTK_INC = $(VTK_INC)' >> $(OPTIONS_FILE))
endif
# Superquadric particles
#
ifeq ($(USE_SUPERQUADRICS), "ON")
BOOST_INC ?= $(BOOST_INC_USR)
# Include test
TMP := $(shell $(ECHO) '\#include "boost/math/special_functions/beta.hpp" \n main(){}' > $(TMPFILE) && $(CXX) $(EXTRA_LIB) $(BOOST_INC) $(EXTRA_ADDLIBS) $(CCFLAGS) -xc++ -o /dev/null $(TMPFILE) 2> /dev/null && echo 0 || echo -1)
ifeq ($(TMP), -1)
$(error 'Could not compile boost example with BOOST_INC="$(BOOST_INC)" as boost/math/special_functions/beta.hpp could not be found')
endif
# Prepare environment
LMP_INC += -DSUPERQUADRIC_ACTIVE_FLAG -DNONSPHERICAL_ACTIVE_FLAG
EXTRA_INC += $(BOOST_INC)
endif
# JPG output for sphere renderings
#
ifeq ($(USE_JPG), "ON")
JPG_INC ?= $(JPG_INC_USR)
JPG_LIB ?= $(JPG_LIB_USR)
JPG_ADDLIBS += -ljpeg
# Test settings
# Include test
TMP := $(shell $(ECHO) '\#include \n main(){}' > $(TMPFILE) && $(CXX) $(EXTRA_LIB) $(JPG_INC) $(EXTRA_ADDLIBS) $(CCFLAGS) -xc++ -o /dev/null $(TMPFILE) 2> /dev/null && echo 0 || echo -1)
ifeq ($(TMP), -1)
$(error 'Could not compile jpg example with JPG_INC="$(JPG_INC)"')
endif
# Linking test
TMP := $(shell $(ECHO) '\#include \n main(){}' > $(TMPFILE) && $(CXX) $(EXTRA_LIB) $(JPG_LIB) $(JPG_INC) $(EXTRA_ADDLIBS) $(JPG_ADDLIBS) $(CCFLAGS) -xc++ -o /dev/null $(TMPFILE) 2> /dev/null && echo 0 || echo -1)
ifeq ($(TMP), -1)
$(error 'Could not compile and link jpg example with JPG_INC="$(JPG_INC)", JPG_LIB="$(JPG_LIB)" and JPG_ADDLIBS="$(JPG_ADDLIBS)"')
endif
# Prepare environment
LMP_INC += -DLAMMPS_JPEG
EXTRA_INC += $(JPG_INC)
EXTRA_LIB += $(JPG_LIB)
EXTRA_ADDLIBS += $(JPG_ADDLIBS)
endif
# Polyhedral particles (premium only)
#
ifeq ($(USE_CONVEX), "ON")
ifneq ($(origin CONVEX_INC_USR), undefined)
CONVEX_INC ?= $(CONVEX_INC_USR)
endif
ifneq ($(origin CONVEX_LIB_USR), undefined)
CONVEX_LIB ?= $(CONVEX_LIB_USR)
endif
# Defaults
CONVEX_INC ?= -I$(LIB_PATH)/libccd/src
CONVEX_LIB ?= -L$(LIB_PATH)/libccd/src
# This should really not be required to be set
CONVEX_ADDLIBS += $(CONVEX_ADDLIBS_USR)
# This is the ccd library
CONVEX_ADDLIBS += -lccd
# Test settings
# Link test
$(info $(CXX) $(EXTRA_LIB) $(CONVEX_LIB) $(CONVEX_INC) $(EXTRA_ADDLIBS) $(CONVEX_ADDLIBS) $(CCFLAGS) -xc++ -o /dev/null $(TMPFILE))
TMP := $(shell $(ECHO) '\#include "ccd/ccd.h" \n main(){}' > $(TMPFILE) && $(CXX) $(EXTRA_LIB) $(CONVEX_LIB) $(CONVEX_INC) $(EXTRA_ADDLIBS) $(CONVEX_ADDLIBS) $(CCFLAGS) -xc++ -o /dev/null $(TMPFILE) 2> /dev/null && echo 0 || echo -1)
# Automatic download and compilation if AUTODOWNLOAD_CONVEX is set
ifeq ($(TMP), -1)
ifeq ($(AUTOINSTALL_CONVEX), "ON")
# Check if sources provide the convex surface model
ifneq ($(wildcard ../surface_model_convex.h),)
$(error 'It appears that you do not posses the source files for the convex hull surface model. Note that this is available only in the premium version of LIGGGHTS.')
endif
$(info 'Could not compile Convex (libccd) example. As AUTOINSTALL_CONVEX is set to "ON". libccd will now be automatically downloaded to ../lib/libccd')
# Check if $(LIB_PATH)/libccd/src folder is available
TMP := $(shell ls $(LIB_PATH)/libccd/src && echo 0 || echo -1)
# If not download libccd
ifeq ($(TMP), -1)
# Create $(LIB_PATH) folder
TMP := $(shell mkdir -p $(LIB_PATH) && echo 0 || echo -1)
ifeq ($(TMP), -1)
$(error 'Could not create $(LIB_PATH) directory')
endif
# Check for git
ifneq (, $(shell which git))
# Download git repository
TMP := $(shell git clone $(LIBCCD_GIT) $(LIB_PATH)/libccd && echo 0 || echo -1)
ifeq ($(TMP), -1)
$(error 'Could not perform "git clone" of $(LIBCCD_GIT) into $(LIB_PATH)/libccd')
endif
# Git not available
else
# Check for wget
ifeq (,$(shell which wget))
$(error "Could not find either git or wget to download libccd. Please install either of the two in order to allow the auto-installation of libccd.")
endif
# Download zip file
TMP := $(shell wget $(LIBCCD_ZIP) -P $(LIB_PATH) &> /dev/null && echo 0 || echo -1)
ifeq ($(TMP), -1)
$(error 'Failed to download libccd using wget. Please install libccd manually')
endif
# Check if unzip is available
ifeq (, $(shell which unzip))
$(error 'Could not find unzip. Please install it to allow the auto-installation of libccd.')
endif
# Unzip file
TMP := $(shell unzip $(LIB_PATH)/$(notdir $(LIBCCD_ZIP)) -d $(LIB_PATH) && echo 0 || echo -1)
ifeq ($(TMP), -1)
$(error 'Could not unzip $(notdir $(LIBCCD_ZIP)) in $(LIB_PATH)')
endif
endif
endif
# At this stage we now have libccd downloaded. Next we need to compile it
OBJDIR := $(PWD)
TMP := $(shell $(ECHO) '\#!/bin/bash \n cd $(OBJDIR)/$(LIB_PATH)/libccd/src \n make PREFIX=$(PWD)/../../ USE_DOUBLE=yes &> /dev/null' > $(TMPFILE))
TMP := $(shell bash $(TMPFILE) && echo 0 || echo -1)
ifeq ($(TMP), -1)
$(error 'Compilation of libccd failed. Please install it manually')
endif
else
$(error 'Could not compile Convex (libccd) example with CONVEX_INC="$(CONVEX_INC)"')
endif
endif
# Include test
TMP := $(shell $(ECHO) '\#include "ccd/ccd.h" \n main(){}' > $(TMPFILE) && $(CXX) $(EXTRA_LIB) $(CONVEX_INC) $(EXTRA_ADDLIBS) $(CCFLAGS) -xc++ -E $(TMPFILE) &> /dev/null && echo 0 || echo -1)
ifeq ($(TMP), -1)
$(error 'Could not compile Convex (libccd) example with CONVEX_INC="$(CONVEX_INC)"')
endif
# Link test
TMP := $(shell $(ECHO) '\#include "ccd/ccd.h" \n main(){}' > $(TMPFILE) && $(CXX) $(EXTRA_LIB) $(CONVEX_LIB) $(CONVEX_INC) $(EXTRA_ADDLIBS) $(CONVEX_ADDLIBS) $(CCFLAGS) -xc++ -o /dev/null $(TMPFILE) 2> /dev/null && echo 0 || echo -1)
ifeq ($(TMP), -1)
$(error 'Could not compile and link Convex (libccd) example with CONVEX_INC="$(CONVEX_INC)", CONVEX_LIB="$(CONVEX_LIB)" and CONVEX_ADDLIBS="$(CONVEX_ADDLIBS)"')
endif
# Prepare environment
LMP_INC += -DNONSPHERICAL_ACTIVE_FLAG -DCONVEX_ACTIVE_FLAG
EXTRA_INC += $(CONVEX_INC)
EXTRA_LIB += $(CONVEX_LIB)
EXTRA_ADDLIBS += $(CONVEX_ADDLIBS)
endif
# Add pre-processor defines to includes
EXTRA_INC += $(LMP_INC)
# For mingw redefine the target
ifeq ($(MINGW), 1)
TARGET = $(EXE).exe
else
TARGET = $(EXE)
endif
$(shell rm $(TMPFILE))
# ---------------------------------------------------------------------
# build rules and dependencies
# no need to edit this section
include Makefile.package.settings
include Makefile.package
EXTRA_INC += $(PKG_INC) $(PKG_SYSINC)
EXTRA_LIB += $(PKG_LIB) $(PKG_SYSLIB)
EXTRA_PATH += $(PKG_PATH) $(PKG_SYSPATH)
EXTRA_ADDLIBS += $(PKG_ADDLIBS) $(PKG_SYSADDLIBS)
# Path to src files
ifeq ($(MINGW), 0)
vpath %.cpp ..
vpath %.h ..
endif
# Link target
ifeq ($(MINGW), 1)
$(EXE): $(TARGET) ../MAKE/mingw_cross.nsis
makensis ../MAKE/mingw_cross.nsis
(cd ..; zip -0 lammps-icms-win.zip lammps-icms-win.exe)
touch $(EXE)
endif
$(TARGET): $(OBJ)
$(LINK) $(LDFLAGS) $(OBJ) $(EXTRA_PATH) $(EXTRA_LIB) $(EXTRA_ADDLIBS) -o $(EXE)
$(SIZE) $(EXE)
# Library targets
lib: $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ)
shlib: $(OBJ)
$(CXX) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \
$(OBJ) $(EXTRA_ADDLIBS) $(EXTRA_LIB)
# Compilation rules
%.o:%.cpp
$(CXX) $(CCFLAGS) $(SHFLAGS) $(EXTRA_PATH) $(EXTRA_INC) -c $<
%.d:%.cpp
$(CXX) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@
# Individual dependencies
ifeq ($(MINGW), 1)
mpi.o: ../STUBS/mpi.c ../STUBS/mpi.h
$(CXX) $(CCFLAGS) $(EXTRA_INC) -c $<
endif
DEPENDS = $(OBJ:.o=.d)
sinclude $(DEPENDS)
log.liggghts:____________________________________________________________________________________________________________________
LIGGGHTS (Version LIGGGHTS-PUBLIC 3.7.0, compiled 2017-10-05-11:08:24 by lab_home, git commit unknown)
medvedeg | Fri, 10/06/2017 - 15:32
What does "make auto" say
What does "make auto" say (without "make clean-all")? You can make a compilation log file by "make auto > log.txt" and share the content of log.txt with us here.
jshan432 | Fri, 10/06/2017 - 21:28
Alexander,
Alexander,
log.txt contains:
Creating list of contact models completed.
c++ -funroll-loops -fstrict-aliasing -Wall -Wno-unused-result -O2 -fPIC -I../STUBS -c ../universe.cpp
c++ -lstdc++ -O2 angle.o angle_hybrid.o atom.o atom_map.o atom_vec.o atom_vec_atomic.o atom_vec_charge.o atom_vec_ellipsoid.o atom_vec_hybrid.o atom_vec_line.o atom_vec_sph.o atom_vec_sph_var.o atom_vec_sphere.o atom_vec_sphere_w.o bond.o bond_hybrid.o bounding_box.o cfd_datacoupling.o cfd_datacoupling_file.o cfd_datacoupling_mpi.o cfd_regionmodel_none.o change_box.o citeme.o comm.o compute.o compute_atom_molecule.o compute_bond_local.o compute_centro_atom.o compute_cluster_atom.o compute_cna_atom.o compute_com.o compute_com_molecule.o compute_contact_atom.o compute_coord_atom.o compute_displace_atom.o compute_erotate.o compute_erotate_multisphere.o compute_erotate_sphere.o compute_erotate_sphere_atom.o compute_group_group.o compute_gyration.o compute_gyration_molecule.o compute_inertia_molecule.o compute_ke.o compute_ke_atom.o compute_ke_multisphere.o compute_msd.o compute_msd_molecule.o compute_nparticles_tracer_region.o compute_pair_gran_local.o compute_pe.o compute_pe_atom.o compute_pressure.o compute_property_atom.o compute_property_local.o compute_property_molecule.o compute_rdf.o compute_reduce.o compute_reduce_region.o compute_rigid.o compute_slice.o compute_stress_atom.o compute_surface.o compute_temp.o contact_models.o container_base.o create_atoms.o create_box.o custom_value_tracker.o delete_atoms.o delete_bonds.o dihedral.o dihedral_hybrid.o displace_atoms.o domain.o dump.o dump_atom_vtk.o dump_custom.o dump_custom_vtk.o dump_custom_vtm.o dump_decomposition_vtk.o dump_euler_vtk.o dump_image.o dump_local.o dump_local_gran.o dump_local_gran_vtk.o dump_mesh.o dump_mesh_stl.o dump_mesh_vtk.o dump_movie.o dump_particle.o dump_vtk.o dump_xyz.o error.o finish.o fix.o fix_adapt.o fix_addforce.o fix_ave_atom.o fix_ave_correlate.o fix_ave_euler.o fix_ave_histo.o fix_ave_spatial.o fix_ave_time.o fix_aveforce.o fix_base_liggghts.o fix_box_relax.o fix_buoyancy.o fix_cfd_coupling.o fix_cfd_coupling_convection.o fix_cfd_coupling_convection_impl.o fix_cfd_coupling_convection_species.o fix_cfd_coupling_force.o fix_cfd_coupling_force_implicit.o fix_check_timestep_gran.o fix_check_timestep_sph.o fix_contact_history.o fix_contact_history_mesh.o fix_contact_property_atom.o fix_contact_property_atom_wall.o fix_continuum_weighted.o fix_deform.o fix_deform_check.o fix_diam_max.o fix_drag.o fix_dt_reset.o fix_efield.o fix_enforce2d.o fix_external.o fix_fiber_spring_simple.o fix_freeze.o fix_gravity.o fix_heat_gran.o fix_heat_gran_conduction.o fix_insert.o fix_insert_pack.o fix_insert_rate_region.o fix_insert_stream.o fix_lb_coupling_onetoone.o fix_lineforce.o fix_massflow_mesh.o fix_massflow_mesh_sieve.o fix_mesh.o fix_mesh_surface.o fix_minimize.o fix_momentum.o fix_move.o fix_move_mesh.o fix_multicontact_halfspace.o fix_multisphere.o fix_multisphere_break.o fix_multisphere_comm.o fix_neighlist_mesh.o fix_nve.o fix_nve_limit.o fix_nve_noforce.o fix_nve_sph.o fix_nve_sph_stationary.o fix_nve_sphere.o fix_particledistribution_discrete.o fix_planeforce.o fix_print.o fix_property_atom.o fix_property_atom_region_tracer.o fix_property_atom_tracer.o fix_property_atom_tracer_stream.o fix_property_global.o fix_read_restart.o fix_region_variable.o fix_respa.o fix_rigid.o fix_scalar_transport_equation.o fix_setforce.o fix_sph.o fix_sph_density_continuity.o fix_sph_density_corr.o fix_sph_density_summation.o fix_sph_pressure.o fix_spring.o fix_spring_rg.o fix_spring_self.o fix_store.o fix_store_force.o fix_store_state.o fix_template_multiplespheres.o fix_template_multisphere.o fix_template_sphere.o fix_viscous.o fix_wall.o fix_wall_gran.o fix_wall_region.o fix_wall_region_sph.o fix_wall_sph.o force.o global_properties.o granular_pair_style.o granular_wall.o group.o image.o improper.o improper_hybrid.o input.o input_mesh_tet.o input_mesh_tri.o input_multisphere.o integrate.o irregular.o kspace.o lammps.o lattice.o library.o library_cfd_coupling.o main.o math_extra.o memory.o mesh_module.o mesh_module_liquidtransfer.o mesh_module_stress.o mesh_module_stress_servo.o mesh_mover_linear.o mesh_mover_rotation.o min.o min_cg.o min_linesearch.o minimize.o modified_andrew.o modify.o modify_liggghts.o multisphere.o multisphere_parallel.o neigh_bond.o neigh_derive.o neigh_dummy.o neigh_full.o neigh_gran.o neigh_half_bin.o neigh_half_multi.o neigh_half_nsq.o neigh_list.o neigh_request.o neigh_respa.o neigh_stencil.o neighbor.o output.o pair.o pair_gran.o pair_gran_proxy.o pair_hybrid.o pair_hybrid_overlay.o pair_soft.o pair_sph.o pair_sph_artvisc_tenscorr.o particleToInsert.o particleToInsert_multisphere.o procmap.o properties.o property_registry.o random.o random_mars.o random_park.o read_data.o read_dump.o read_restart.o reader.o reader_native.o reader_xyz.o region.o region_block.o region_cone.o region_cylinder.o region_intersect.o region_mesh_tet.o region_neighbor_list.o region_plane.o region_prism.o region_sphere.o region_union.o region_wedge.o replicate.o respa.o rotate.o run.o run_time.o set.o signal_handling.o sort_buffer.o special.o tet_mesh.o thermo.o timer.o tri_mesh.o tri_mesh_planar.o universe.o update.o variable.o velocity.o verlet.o write_data.o write_dump.o write_restart.o -L../STUBS -lmpi_stubs -o ../lmp_auto
size ../lmp_auto
__TEXT __DATA __OBJC others dec hex
20725760 1232896 0 4310724608 4332683264 1023f8000
Jackson
medvedeg | Sat, 10/07/2017 - 19:33
Do you compile it in Linix or
Do you compile it in Linix or Windows?
What I see here, MPI is not used (or not instlled) and hence VTK is not linked. Did you install them correctly? VTK will not work without MPI
jshan432 | Sat, 10/07/2017 - 22:21
Alexander,
Alexander,
I'm running on a Mac. I thought I installed MPI correctly, but I will double check and try again.
Jackson
jshan432 | Sat, 10/07/2017 - 23:12
I reinstalled mpi and
I reinstalled mpi and repeated the previously discussed steps with the same outcome, no custom/vtk listed as an available dump style.
medvedeg | Mon, 10/09/2017 - 10:39
Dear Jackson,
Dear Jackson,
please check it again by typing "mpirun --version" and "mpicc --version" or "mpicxx --version". What I can see from this:
c++ -funroll-loops -fstrict-aliasing -Wall -Wno-unused-result -O2 -fPIC -I../STUBS -c ../universe.cpp
is that the code compiled by "c++", not "mpicc" or "mpicxx" and fake MPI is used instead. Please check the paths. You can look in "Makefile.auto.options" if MPI and VTK flags were overwritten and set to OFF (looks like yes).
jshan432 | Mon, 10/09/2017 - 17:13
Alexander,
Alexander,
After removing gcc from the path and recompiling liggghts, I get the same error message as I did before installing gcc:
rm -rf Obj_* *.a *.so MAKE/Makefile.auto.options* lmp_*
sed: illegal option -- -
usage: sed script [-Ealn] [-i extension] [file ...]
sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
Creating list of contact models completed.
Makefile:424: *** 'Could not compile a simple c++ example. Please make sure that you have run "make stubs" before compiling LIGGGHTS itself. Test was done with CXX=c++, EXTRA_INC= -I../STUBS, EXTRA_LIB= -L../STUBS and EXTRA_ADDLIBS= -lmpi_stubs.'. Stop.
make: *** [auto] Error 2
Running "mpicc --version" yields:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.37)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
I can see mpic++, mpicc, mpicxx ect. in usr/local/bin, but it does not look like they are being used??
I really appreciate all your help on this,
Jackson
jshan432 | Mon, 10/09/2017 - 16:10
Alexander,
Alexander,
This is the output when I run the requested commands. I had to install gcc when I first setup liggghts for "make auto" to work and produce the lmp_auto executable. I guess right now gcc is set to my default compiler? How should I change it so mpicc is the default? Also, MPI and VTK flags were not set to OFF.
hyperion:~ lab_home$ mpirun --version
mpirun (Open MPI) 3.0.0
Report bugs to http://www.open-mpi.org/community/help/
hyperion:~ lab_home$ mpicc --version
gcc (GCC) 7.1.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Jackson
arnom | Tue, 10/10/2017 - 10:30
Hi Jason,
Hi Jason,
it seems as if I was too optimistic with Makefile.auto to work on Mac. Unfortunately no one here has a Mac and thus we cannot debug it.
What you can try instead is to use cmake to build Liggghts, as this is also works on Windows. For a rough guide see: https://www.cfdem.com/media/DEM/docu/Section_start.html#building-for-win...
Best,
Arno