Can't execute makefile in Windows 7 - c++

I'm trying to compile library https://github.com/PetterS/SuiteSparse/tree/master/CSparse
with MinGW on Windows 7.
Makefile contents:
C:
( cd Lib ; $(MAKE) )
( cd Demo ; $(MAKE) )
all: C cov
library:
( cd Lib ; $(MAKE) )
cov:
( cd Tcov ; $(MAKE) )
clean:
( cd Lib ; $(MAKE) clean )
( cd Demo ; $(MAKE) clean )
( cd Tcov ; $(MAKE) clean )
( cd MATLAB/CSparse ; $(RM) *.o )
( cd MATLAB/Test ; $(RM) *.o )
purge:
( cd Lib ; $(MAKE) purge )
( cd Demo ; $(MAKE) purge )
( cd Tcov ; $(MAKE) purge )
( cd MATLAB/CSparse ; $(RM) *.o *.mex* )
( cd MATLAB/Test ; $(RM) *.o *.mex* )
distclean: purge
# do not install CSparse; use CXSparse instead
install:
# uninstall CSparse: do nothing
uninstall:
I'im typing in cmd.exe:
PS C:\Users\s\Desktop\CSparse> mingw32-make
( cd Lib ; C:/MinGW/bin/mingw32-make )
process_begin: CreateProcess(NULL, ( cd Lib ; C:/MinGW/bin/mingw32-make ), ...) failed.
make (e=2): The system cannot find the file specified.
Makefile:8: recipe for target 'C' failed
mingw32-make: *** [C] Error 2
My Path variable:
C:\Program Files\PC Connectivity Solution\;C:\watcom-1.3\binnt;C:\watcom-1.3\binw;C:\Program Files\Common Files\Intel\Shared Libraries\redist\ia32\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\python27\;C:\Python27\Scripts;C:\Program Files\MiKTeX 2.9\miktex\bin\;C:\Program Files\Panda3D-1.8.1\python;C:\Program Files\Panda3D-1.8.1\bin;C:\Program Files\Autodesk\Backburner\;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files\Skype\Phone\;C:\Program Files\MATLAB\R2014a\runtime\win32;C:\Program Files\MATLAB\R2014a\bin;C:\MinGW\bin;
I have rebooted Windows already.
I also tried to set path=C:\MinGW\bin in cmd.exe, but nothing have changed.
Can anyone tell me what I'm doing wrong?

I also tried to set path=C:\mingw32\bin in cmd.exe, but nothing have changed.
As far I'm concerned, by typing this you make PATH variable contains only path "C:\mingw32\bin".
Have look at this answer: https://stackoverflow.com/a/9546345/4776786
Try this instead in CMD:
set PATH=%PATH%;C:\mingw32\bin
By executing that command you add that directory to your current PATH variable.
But, in other hand, why you just don't use "My Computer" > "Properties" > "Advanced" > "Environment Variables" > "Path"? Doing this, system reboot will not interrupt your PATH.

Related

'No rule to make target' while using Netbeans on Mac, remote building to Linux host but only with multiple cpp files

This is a strange one (to me).
I'm finding that if I have a project containing multiple cpp files and I am trying to build them on a remote linux host with the Netbeans IDE, it complains about No Rule to make target for the first additional cpp file and then stops. This issue is not present when building the same project locally or when building to a remote Linux host using Netbeans on Linux.
Firstly, some points of note;
I'm using Netbeans on a Mac.
I'm remote building C++ files onto a remote linux host.
This issue only exists when there are multiple cpp files in the project.
This issue does not exist when remote building on a Linux machine.
The issue is the same whether building from the IDE or running make on the remote host.
I can build the project from the command line on the hose using g++[...]
I can only assume the issue is when Netbeans is generating the makefile variables, but for the life of me, cant seem to find where the problem lies and as I say, it's completely fine when doing the same thing on a Linux machine.
To provide some context, we can consider the following small project;
main.cpp
#include <cstdlib>
#include <stdio.h>
#include "other.h"
int main(int argc, char** argv)
{
printf ("hello %d \n",times_two(50));
return 0;
}
other.h
#ifndef OTHER_H
#define OTHER_H
int times_two(int a);
#endif /* OTHER_H */
other.h
int times_two(int a)
{
return a*2;
}
When building from the IDE to the remote Linux host, we get;
CLEAN SUCCESSFUL (total time: 212ms)
Copying project files to /home/plisken/.netbeans/remote/oracle-linux.shared/solaros.local-MacOSX-x86_64 at plisken#oracle-linux.shared
Building project files list...
Checking directory structure...
Checking previously uploaded files...
Checking links...
Uploading changed files:
Checking exec permissions...
Uploading changed files finished successfully.
cd '/home/plisken/.netbeans/remote/oracle-linux.shared/solaros.local-MacOSX-x86_64/Volumes/D_SLAVE/My Documents/My Projects/multiple_cpp_files/multiple_cpp_files'
/usr/bin/gmake -f Makefile CONF=Debug
"/usr/bin/gmake" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
gmake[1]: Entering directory '/home/plisken/.netbeans/remote/oracle-linux.shared/solaros.local-MacOSX-x86_64/Volumes/D_SLAVE/My Documents/My Projects/multiple_cpp_files/multiple_cpp_files'
"/usr/bin/gmake" -f nbproject/Makefile-Debug.mk /home/plisken/PROJECTS/bin/multiple_cpp_files
gmake[2]: Entering directory '/home/plisken/.netbeans/remote/oracle-linux.shared/solaros.local-MacOSX-x86_64/Volumes/D_SLAVE/My Documents/My Projects/multiple_cpp_files/multiple_cpp_files'
gmake[2]: *** No rule to make target '/Volumes/D_SLAVE/My Documents/My Projects/multiple_cpp_files/multiple_cpp_files/other.cpp', needed by 'build/Debug/GNU-Linux/_ext/96b75cbb/other.o'. Stop.
gmake[2]: Leaving directory '/home/plisken/.netbeans/remote/oracle-linux.shared/solaros.local-MacOSX-x86_64/Volumes/D_SLAVE/My Documents/My Projects/multiple_cpp_files/multiple_cpp_files'
gmake[1]: *** [nbproject/Makefile-Debug.mk:60: .build-conf] Error 2
gmake[1]: Leaving directory '/home/plisken/.netbeans/remote/oracle-linux.shared/solaros.local-MacOSX-x86_64/Volumes/D_SLAVE/My Documents/My Projects/multiple_cpp_files/multiple_cpp_files'
gmake: *** [nbproject/Makefile-impl.mk:40: .build-impl] Error 2
BUILD FAILED (exit value 2, total time: 224ms)
The makefiles I believe are relevant and automatically generated are as below;
makefile
#
# There exist several targets which are by default empty and which can be
# used for execution of your targets. These targets are usually executed
# before and after some main targets. They are:
#
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
#
# Targets beginning with '.' are not intended to be called on their own.
#
# Main targets can be executed directly, and they are:
#
# build build a specific configuration
# clean remove built files from a configuration
# clobber remove all built files
# all build all configurations
# help print help mesage
#
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
# .help-impl are implemented in nbproject/makefile-impl.mk.
#
# Available make variables:
#
# CND_BASEDIR base directory for relative paths
# CND_DISTDIR default top distribution directory (build artifacts)
# CND_BUILDDIR default top build directory (object files, ...)
# CONF name of current configuration
# CND_PLATFORM_${CONF} platform name (current configuration)
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
#
# NOCDDL
# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
# build
build: .build-post
.build-pre:
# Add your pre 'build' code here...
.build-post: .build-impl
# Add your post 'build' code here...
# clean
clean: .clean-post
.clean-pre:
# Add your pre 'clean' code here...
.clean-post: .clean-impl
# Add your post 'clean' code here...
# clobber
clobber: .clobber-post
.clobber-pre:
# Add your pre 'clobber' code here...
.clobber-post: .clobber-impl
# Add your post 'clobber' code here...
# all
all: .all-post
.all-pre:
# Add your pre 'all' code here...
.all-post: .all-impl
# Add your post 'all' code here...
# build tests
build-tests: .build-tests-post
.build-tests-pre:
# Add your pre 'build-tests' code here...
.build-tests-post: .build-tests-impl
# Add your post 'build-tests' code here...
# run tests
test: .test-post
.test-pre: build-tests
# Add your pre 'test' code here...
.test-post: .test-impl
# Add your post 'test' code here...
# help
help: .help-post
.help-pre:
# Add your pre 'help' code here...
.help-post: .help-impl
# Add your post 'help' code here...
# include project implementation makefile
include nbproject/Makefile-impl.mk
# include project make variables
include nbproject/Makefile-variables.mk
Makefile-impl.mk
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a pre- and a post- target defined where you can add customization code.
#
# This makefile implements macros and targets common to all configurations.
#
# NOCDDL
# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
# and .clean-reqprojects-conf unless SUB has the value 'no'
SUB_no=NO
SUBPROJECTS=${SUB_${SUB}}
BUILD_SUBPROJECTS_=.build-subprojects
BUILD_SUBPROJECTS_NO=
BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
CLEAN_SUBPROJECTS_=.clean-subprojects
CLEAN_SUBPROJECTS_NO=
CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
# Project Name
PROJECTNAME=multiple_cpp_files
# Active Configuration
DEFAULTCONF=Debug
CONF=${DEFAULTCONF}
# All Configurations
ALLCONFS=Debug Release
# build
.build-impl: .build-pre .validate-impl .depcheck-impl
##echo "=> Running $#... Configuration=$(CONF)"
"${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf
# clean
.clean-impl: .clean-pre .validate-impl .depcheck-impl
##echo "=> Running $#... Configuration=$(CONF)"
"${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf
# clobber
.clobber-impl: .clobber-pre .depcheck-impl
##echo "=> Running $#..."
for CONF in ${ALLCONFS}; \
do \
"${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf; \
done
# all
.all-impl: .all-pre .depcheck-impl
##echo "=> Running $#..."
for CONF in ${ALLCONFS}; \
do \
"${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf; \
done
# build tests
.build-tests-impl: .build-impl .build-tests-pre
##echo "=> Running $#... Configuration=$(CONF)"
"${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-tests-conf
# run tests
.test-impl: .build-tests-impl .test-pre
##echo "=> Running $#... Configuration=$(CONF)"
"${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .test-conf
# dependency checking support
.depcheck-impl:
#echo "# This code depends on make tool being used" >.dep.inc
#if [ -n "${MAKE_VERSION}" ]; then \
echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES} \$${TESTOBJECTFILES}))" >>.dep.inc; \
echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
echo "include \$${DEPFILES}" >>.dep.inc; \
echo "endif" >>.dep.inc; \
else \
echo ".KEEP_STATE:" >>.dep.inc; \
echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
fi
# configuration validation
.validate-impl:
#if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
then \
echo ""; \
echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \
echo "See 'make help' for details."; \
echo "Current directory: " `pwd`; \
echo ""; \
fi
#if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
then \
exit 1; \
fi
# help
.help-impl: .help-pre
#echo "This makefile supports the following configurations:"
#echo " ${ALLCONFS}"
#echo ""
#echo "and the following targets:"
#echo " build (default target)"
#echo " clean"
#echo " clobber"
#echo " all"
#echo " help"
#echo ""
#echo "Makefile Usage:"
#echo " make [CONF=<CONFIGURATION>] [SUB=no] build"
#echo " make [CONF=<CONFIGURATION>] [SUB=no] clean"
#echo " make [SUB=no] clobber"
#echo " make [SUB=no] all"
#echo " make help"
#echo ""
#echo "Target 'build' will build a specific configuration and, unless 'SUB=no',"
#echo " also build subprojects."
#echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no',"
#echo " also clean subprojects."
#echo "Target 'clobber' will remove all built files from all configurations and,"
#echo " unless 'SUB=no', also from subprojects."
#echo "Target 'all' will will build all configurations and, unless 'SUB=no',"
#echo " also build subprojects."
#echo "Target 'help' prints this message."
#echo ""
Makefile-variables.mk
#
# Generated - do not edit!
#
# NOCDDL
#
CND_BASEDIR=`pwd`
CND_BUILDDIR=build
CND_DISTDIR=dist
# Debug configuration
CND_PLATFORM_Debug=GNU-Linux
CND_ARTIFACT_DIR_Debug=/home/plisken/PROJECTS/bin
CND_ARTIFACT_NAME_Debug=multiple_cpp_files
CND_ARTIFACT_PATH_Debug=/home/plisken/PROJECTS/bin/multiple_cpp_files
CND_PACKAGE_DIR_Debug=dist/Debug/GNU-Linux/package
CND_PACKAGE_NAME_Debug=multiplecppfiles.tar
CND_PACKAGE_PATH_Debug=dist/Debug/GNU-Linux/package/multiplecppfiles.tar
# Release configuration
CND_PLATFORM_Release=GNU-MacOSX
CND_ARTIFACT_DIR_Release=dist/Release/GNU-MacOSX
CND_ARTIFACT_NAME_Release=multiple_cpp_files
CND_ARTIFACT_PATH_Release=dist/Release/GNU-MacOSX/multiple_cpp_files
CND_PACKAGE_DIR_Release=dist/Release/GNU-MacOSX/package
CND_PACKAGE_NAME_Release=multiplecppfiles.tar
CND_PACKAGE_PATH_Release=dist/Release/GNU-MacOSX/package/multiplecppfiles.tar
#
# include compiler specific variables
#
# dmake command
ROOT:sh = test -f nbproject/private/Makefile-variables.mk || \
(mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk)
#
# gmake command
.PHONY: $(shell test -f nbproject/private/Makefile-variables.mk || (mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk))
#
include nbproject/private/Makefile-variables.mk
Makefile-debug.mk
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a -pre and a -post target defined where you can add customized code.
#
# This makefile implements configuration specific macros and targets.
# Environment
MKDIR=mkdir
CP=cp
GREP=grep
NM=nm
CCADMIN=CCadmin
RANLIB=ranlib
CC=gcc
CCC=g++
CXX=g++
FC=gfortran
AS=as
# Macros
CND_PLATFORM=GNU-Linux
CND_DLIB_EXT=so
CND_CONF=Debug
CND_DISTDIR=dist
CND_BUILDDIR=build
# Include project Makefile
include Makefile
# Object Directory
OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}
# Object Files
OBJECTFILES= \
${OBJECTDIR}/_ext/96b75cbb/other.o \
${OBJECTDIR}/main.o
# C Compiler Flags
CFLAGS=
# CC Compiler Flags
CCFLAGS=
CXXFLAGS=
# Fortran Compiler Flags
FFLAGS=
# Assembler Flags
ASFLAGS=
# Link Libraries and Options
LDLIBSOPTIONS=
# Build Targets
.build-conf: ${BUILD_SUBPROJECTS}
"${MAKE}" -f nbproject/Makefile-${CND_CONF}.mk /home/plisken/PROJECTS/bin/multiple_cpp_files
/home/plisken/PROJECTS/bin/multiple_cpp_files: ${OBJECTFILES}
${MKDIR} -p /home/plisken/PROJECTS/bin
${LINK.cc} -o /home/plisken/PROJECTS/bin/multiple_cpp_files ${OBJECTFILES} ${LDLIBSOPTIONS}
${OBJECTDIR}/_ext/96b75cbb/other.o: /Volumes/D_SLAVE/My\ Documents/My\ Projects/multiple_cpp_files/multiple_cpp_files/other.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/96b75cbb
${RM} "$#.d"
$(COMPILE.cc) -g -I/Volumes/D_SLAVE/My\ Documents/My\ Projects/multiple_cpp_files/multiple_cpp_files -MMD -MP -MF "$#.d" -o ${OBJECTDIR}/_ext/96b75cbb/other.o /Volumes/D_SLAVE/My\ Documents/My\ Projects/multiple_cpp_files/multiple_cpp_files/other.cpp
${OBJECTDIR}/main.o: main.cpp
${MKDIR} -p ${OBJECTDIR}
${RM} "$#.d"
$(COMPILE.cc) -g -I/Volumes/D_SLAVE/My\ Documents/My\ Projects/multiple_cpp_files/multiple_cpp_files -MMD -MP -MF "$#.d" -o ${OBJECTDIR}/main.o main.cpp
# Subprojects
.build-subprojects:
# Clean Targets
.clean-conf: ${CLEAN_SUBPROJECTS}
${RM} -r ${CND_BUILDDIR}/${CND_CONF}
# Subprojects
.clean-subprojects:
# Enable dependency checking
.dep.inc: .depcheck-impl
include .dep.inc
To be clear, if I log onto the remote host where the files are and run;
g++ -o test main.cpp other.cpp
it naturally builds completely fine.
Any suggestions would be greatly appreciated.

MakeFile not executing by mingw32-make

I am trying to run code of a GitHub repository. Link --> https://github.com/ViDA-NYU/urban-pulse#windows-7-8-10
This first build executes a MakeFile through a mingw32-make command on cmd.exe. That execution is showing a "syntax error: unexpected end of file" error.
(https://drive.google.com/open?id=1CJErtpVviLCileL0xPNaHyBnkVoqJBWf).
https://drive.google.com/open?id=1CJErtpVviLCileL0xPNaHyBnkVoqJBWf
I tried to execute it with MinGW mingw32-make and MSYS make but none worked. I have installed MinGW from the official website.
Here is the MakeFile up to line 43. The name of the file is "MakeFile"
#############################################################################
# Makefile for building: ComputePulse
# Generated by qmake (3.0) (Qt 5.6.2)
# Project: ComputePulse.pro
# Template: subdirs
# Command: C:\Users\Kanishk\Anaconda3\Library\bin\qmake.exe -o Makefile ComputePulse.pro
#############################################################################
MAKEFILE = Makefile
first: make_first
QMAKE = C:\Users\Kanishk\Anaconda3\Library\bin\qmake.exe
DEL_FILE = del
CHK_DIR_EXISTS= if not exist
MKDIR = mkdir
COPY = copy /y
COPY_FILE = copy /y
COPY_DIR = xcopy /s /q /y /i
INSTALL_FILE = copy /y
INSTALL_PROGRAM = copy /y
INSTALL_DIR = xcopy /s /q /y /i
DEL_FILE = del
SYMLINK = $(QMAKE) -install ln -f -s
DEL_DIR = rmdir
MOVE = move
SUBTARGETS = \
sub-Scalars-Scalars-pro \
sub-PulseJNI-Pulse-pro
sub-Scalars-Scalars-pro-qmake_all: FORCE
#if not exist Scalars\ mkdir Scalars\ & if not exist Scalars\ exit 1
cd Scalars\ && $(QMAKE) E:\BTP\urban-pulse-master\ComputePulse\Scalars\Scalars.pro -o Makefile
#set MAKEFLAGS=$(MAKEFLAGS)
cd Scalars\ && $(MAKE) -f Makefile qmake_all
sub-Scalars-Scalars-pro: FORCE
#if not exist Scalars\ mkdir Scalars\ & if not exist Scalars\ exit 1
#set MAKEFLAGS=$(MAKEFLAGS)
cd Scalars\ && ( if not exist Makefile $(QMAKE) E:\BTP\urban-pulse-master\ComputePulse\Scalars\Scalars.pro -o Makefile ) && $(MAKE) -f Makefile
sub-Scalars-Scalars-pro-make_first: FORCE
#if not exist Scalars\ mkdir Scalars\ & if not exist Scalars\ exit 1
#set MAKEFLAGS=$(MAKEFLAGS)
cd Scalars\ && ( if not exist Makefile $(QMAKE) E:\BTP\urban-pulse-master\ComputePulse\Scalars\Scalars.pro -o Makefile ) && $(MAKE) -f Makefile
The execution is expected to create two executables named Scalars and Pulse. Information is also available on the link above.

Error when building veins_inet subproject

I have imported the veins_inet subproject when importing the veins 4.5 project (by selecting the "Search for nested projects") in Omnet++.
I have built veins and can run the Erlangen example.
However, I cannot build the veins_inet project.
The sources can be found here: https://github.com/sommer/veins/tree/master/subprojects/veins_inet
I get the following error:
make MODE=debug all
make[1]: Entering directory '/home/XX/omnetpp-5.1.1/samples/veins/subprojects/veins_inet/src'
veins_inet/VeinsInetManager.cc
veins_inet/VeinsInetManager.cc:21:41: fatal error: veins_inet/VeinsInetManager.h: No such file or directory
compilation terminated.
Makefile:97: recipe for target '../out/gcc-debug/src/veins_inet/VeinsInetManager.o' failed
make[1]: Leaving directory '/home/XX/omnetpp-5.1.1/samples/veins/subprojects/veins_inet/src'
Makefile:12: recipe for target 'all' failed
make[1]: *** [../out/gcc-debug/src/veins_inet/VeinsInetManager.o] Error 1
make: *** [all] Error 2
It seems like the header files have failed to be included.
I can bypass the "No such file or directory" errors by manually copying all necessary *.h files into the veins_inet/src/veins_inet folder and editing the *.cc and *.h files, such that the compiler finds the required header files.
I guess the issue lies in the Makefiles, or rather in the configure file, which generates the Makefiles.
veins_inet/configure:
#!/usr/bin/env python
"""
Creates Makefile(s) for building Veins_INET.
"""
import os
import sys
import subprocess
from logging import warning, error
from optparse import OptionParser
# Option handling
parser = OptionParser()
parser.add_option("--with-veins", dest="veins", help="link Veins_INET with a version of Veins installed in PATH [default: do not link with Veins]", metavar="PATH", default="../..")
parser.add_option("--with-inet", dest="inet", help="link Veins_INET with a version of the INET Framework installed in PATH [default: do not link with INET]", metavar="PATH", default="../../../inet")
(options, args) = parser.parse_args()
if args:
warning("Superfluous command line arguments: \"%s\"" % " ".join(args))
# Start with default flags
makemake_flags = ['-f', '--deep', '--no-deep-includes', '--make-so', '-I', '.', '-o', 'veins_inet', '-O', 'out']
run_libs = [os.path.join('src', 'veins_inet')]
run_neds = [os.path.join('src', 'veins_inet')]
# Add flags for Veins
if options.veins:
check_fname = os.path.join(options.veins, 'src/veins/package.ned')
expect_version = '4'
if not os.path.isfile(check_fname):
error('Could not find Veins (by looking for %s). Check the path to Veins (--with-veins=... option) and the Veins version (should be version %s)' % (check_fname, expect_version))
sys.exit(1)
veins_header_dirs = [os.path.join(os.path.relpath(options.veins, 'src'), 'src')]
veins_includes = ['-I' + s for s in veins_header_dirs]
veins_link = ["-L" + os.path.join(os.path.relpath(options.veins, 'src'), 'src'), "-lveins"]
veins_defs = []
makemake_flags += veins_includes + veins_link + veins_defs
run_libs = [os.path.relpath(os.path.join(options.veins, 'src', 'veins'))] + run_libs
run_neds = [os.path.relpath(os.path.join(options.veins, 'src', 'veins'))] + run_neds
# Add flags for INET
if options.inet:
fname = os.path.join(options.inet, '_scripts/get_version')
expect_version = '3.4.0'
try:
print 'Running "%s" to determine INET version.' % fname
version = subprocess.check_output(fname).strip()
if not version == expect_version:
warning('Unsupported INET Version. Expecting %s, found "%s"' % (expect_version, version))
else:
print 'Found INET version "%s". Okay.' % version
except OSError as e:
error('Could not determine INET Version (by running %s): %s. Check the path to INET (--with-inet=... option) and the INET version (should be version %s)' % (fname, e, expect_version))
sys.exit(1)
inet_header_dirs = [os.path.join(os.path.relpath(options.inet, 'src'), 'src')]
inet_includes = ['-I' + s for s in inet_header_dirs]
inet_link = ["-L" + os.path.join(os.path.relpath(options.inet, 'src'), 'src'), "-lINET"]
inet_defs = ["-DINET_IMPORT"]
makemake_flags += inet_includes + inet_link + inet_defs
run_libs = [os.path.relpath(os.path.join(options.inet, 'src', 'INET'))] + run_libs
run_neds = [os.path.relpath(os.path.join(options.inet, 'src'))] + run_neds
# Start creating files
if not os.path.isdir('out'):
os.mkdir('out')
f = open(os.path.join('out', 'config.py'), 'w')
f.write('run_libs = %s\n' % repr(run_libs))
f.write('run_neds = %s\n' % repr(run_neds))
f.close()
subprocess.check_call(['env', 'opp_makemake'] + makemake_flags, cwd='src')
print 'Configure done. You can now run "make".'
veins_inet/Makefile
.PHONY: all makefiles clean cleanall doxy
# if out/config.py exists, we can also create command line scripts for running simulations
ADDL_TARGETS =
ifeq ($(wildcard out/config.py),)
else
ADDL_TARGETS += run debug memcheck
endif
# default target
all: src/Makefile $(ADDL_TARGETS)
#cd src && $(MAKE)
# command line scripts
run debug memcheck: % : src/scripts/%.in.py out/config.py
#echo "Creating script \"./$#\""
#head -n1 "$<" > "$#"
#cat out/config.py >> "$#"
#tail -n+2 "$<" >> "$#"
#chmod a+x "$#"
# legacy
makefiles:
#echo
#echo '====================================================================='
#echo 'Warning: make makefiles has been deprecated in favor of ./configure'
#echo '====================================================================='
#echo
./configure
#echo
#echo '====================================================================='
#echo 'Warning: make makefiles has been deprecated in favor of ./configure'
#echo '====================================================================='
#echo
clean: src/Makefile
cd src && $(MAKE) clean
rm -f run debug memcheck
cleanall: src/Makefile
cd src && $(MAKE) MODE=release clean
cd src && $(MAKE) MODE=debug clean
rm -f src/Makefile
rm -f run debug memcheck
src/Makefile:
#echo
#echo '====================================================================='
#echo '$# does not exist.'
#echo 'Please run "./configure" or use the OMNeT++ IDE to generate it.'
#echo '====================================================================='
#echo
#exit 1
out/config.py:
#echo
#echo '====================================================================='
#echo '$# does not exist.'
#echo 'Please run "./configure" to generate it.'
#echo '====================================================================='
#echo
#exit 1
# autogenerated documentation
doxy:
doxygen doxy.cfg
doxyshow: doxy
xdg-open doc/doxy/index.html
veins_inet/src/Makefile
#
# OMNeT++/OMNEST Makefile for $(LIB_PREFIX)veins_inet
#
# This file was generated with the command:
# opp_makemake --make-so -f --deep -KINET_PROJ=../../../../inet -KVEINS_PROJ=../../.. -L$$\(INET_PROJ\)/out/$$\(CONFIGNAME\)/src -L$$\(VEINS_PROJ\)/out/$$\(CONFIGNAME\)/src -lINET -lveins
#
# Name of target to be created (-o option)
TARGET = $(LIB_PREFIX)veins_inet$(SHARED_LIB_SUFFIX)
# C++ include paths (with -I)
INCLUDE_PATH =
# Additional object and library files to link with
EXTRA_OBJS =
# Additional libraries (-L, -l options)
LIBS = $(LDFLAG_LIBPATH)$(INET_PROJ)/out/$(CONFIGNAME)/src $(LDFLAG_LIBPATH)$(VEINS_PROJ)/out/$(CONFIGNAME)/src -lINET -lveins
# Output directory
PROJECT_OUTPUT_DIR = ../out
PROJECTRELATIVE_PATH = src
O = $(PROJECT_OUTPUT_DIR)/$(CONFIGNAME)/$(PROJECTRELATIVE_PATH)
# Object files for local .cc, .msg and .sm files
OBJS = $O/veins_inet/VeinsInetManager.o $O/veins_inet/VeinsInetMobility.o
# Message files
MSGFILES =
# SM files
SMFILES =
# Other makefile variables (-K)
INET_PROJ=../../../../inet
VEINS_PROJ=../../..
#------------------------------------------------------------------------------
# Pull in OMNeT++ configuration (Makefile.inc)
ifneq ("$(OMNETPP_CONFIGFILE)","")
CONFIGFILE = $(OMNETPP_CONFIGFILE)
else
ifneq ("$(OMNETPP_ROOT)","")
CONFIGFILE = $(OMNETPP_ROOT)/Makefile.inc
else
CONFIGFILE = $(shell opp_configfilepath)
endif
endif
ifeq ("$(wildcard $(CONFIGFILE))","")
$(error Config file '$(CONFIGFILE)' does not exist -- add the OMNeT++ bin directory to the path so that opp_configfilepath can be found, or set the OMNETPP_CONFIGFILE variable to point to Makefile.inc)
endif
include $(CONFIGFILE)
# Simulation kernel and user interface libraries
OMNETPP_LIBS = -loppenvir$D $(KERNEL_LIBS) $(SYS_LIBS)
ifneq ($(TOOLCHAIN_NAME),clangc2)
LIBS += -Wl,-rpath,$(abspath $(INET_PROJ)/out/$(CONFIGNAME)/src) -Wl,-rpath,$(abspath $(VEINS_PROJ)/out/$(CONFIGNAME)/src)
endif
COPTS = $(CFLAGS) $(IMPORT_DEFINES) $(INCLUDE_PATH) -I$(OMNETPP_INCL_DIR)
MSGCOPTS = $(INCLUDE_PATH)
SMCOPTS =
# we want to recompile everything if COPTS changes,
# so we store COPTS into $COPTS_FILE and have object
# files depend on it (except when "make depend" was called)
COPTS_FILE = $O/.last-copts
ifneq ("$(COPTS)","$(shell cat $(COPTS_FILE) 2>/dev/null || echo '')")
$(shell $(MKPATH) "$O" && echo "$(COPTS)" >$(COPTS_FILE))
endif
#------------------------------------------------------------------------------
# User-supplied makefile fragment(s)
# >>>
# <<<
#------------------------------------------------------------------------------
# Main target
all: $O/$(TARGET)
$(Q)$(LN) $O/$(TARGET) .
$O/$(TARGET): $(OBJS) $(wildcard $(EXTRA_OBJS)) Makefile $(CONFIGFILE)
#$(MKPATH) $O
#echo Creating shared library: $#
$(Q)$(SHLIB_LD) -o $O/$(TARGET) $(OBJS) $(EXTRA_OBJS) $(AS_NEEDED_OFF) $(WHOLE_ARCHIVE_ON) $(LIBS) $(WHOLE_ARCHIVE_OFF) $(OMNETPP_LIBS) $(LDFLAGS)
$(Q)$(SHLIB_POSTPROCESS) $O/$(TARGET)
.PHONY: all clean cleanall depend msgheaders smheaders
.SUFFIXES: .cc
$O/%.o: %.cc $(COPTS_FILE) | msgheaders smheaders
#$(MKPATH) $(dir $#)
$(qecho) "$<"
$(Q)$(CXX) -c $(CXXFLAGS) $(COPTS) -o $# $<
%_m.cc %_m.h: %.msg
$(qecho) MSGC: $<
$(Q)$(MSGC) -s _m.cc $(MSGCOPTS) $?
%_sm.cc %_sm.h: %.sm
$(qecho) SMC: $<
$(Q)$(SMC) -c++ -suffix cc $(SMCOPTS) $?
msgheaders: $(MSGFILES:.msg=_m.h)
smheaders: $(SMFILES:.sm=_sm.h)
clean:
$(qecho) Cleaning...
$(Q)-rm -rf $O
$(Q)-rm -f $(TARGET)
$(Q)-rm -f $(call opp_rwildcard, . , *_m.cc *_m.h *_sm.cc *_sm.h)
cleanall: clean
$(Q)-rm -rf $(PROJECT_OUTPUT_DIR)
# include all dependencies
-include $(OBJS:%.o=%.d)
Has anybody solved the issue ?
To solve the problem I had to add missing "Include Paths" to the project properties:
1. Select your veins_inet project and click Project>>Properties in Omnet++
2. In the new window expand the OMNeT++ entry and select Makemake
3. select src:makemake(deep,recurse)-->veins_inet(dynamic lib)
4. Click on the Options... button
It should look like this: Properties for veins_inet window
5. Go to the Compile tab in the window that opens
6. Enter the missing include directories:
[workspace]/veins/subprojects/veins_ine‌​‌​t/src
[workspace]/veins/src
[workspace]/inet/src
You should end up with something similar: Makemake Options window
7. Click OK in both windows
8. You should be able to build the veins_inet project without errors
if you use omnet++ 5.0 version :
IDE Project->properties->OMNET++ -> Makemake -> select src -> build makemake selected options button -> compile -> check [add all source folders under this deep makefile] :: then refresh and build project ..

Building Armadillo linear algebra library, failing to link with SuperLU on Ubuntu 14.04.3 LTS. X cannot be used when making a shared object

I am trying to install the latest version of Armadillo (6.500.5) http://arma.sourceforge.net/ on Ubuntu 14.04.3 LTS.
I require the ability to solve sparse linear systems, so as per the instructions I need SuperLU version 4.3 installed. I installed SuperLU 4.3, but when trying to build Armadillo I receive the following error
Scanning dependencies of target armadillo
[100%] Building CXX object CMakeFiles/armadillo.dir/src/wrapper.cpp.o
Linking CXX shared library libarmadillo.so
/usr/bin/ld: /usr/lib/SuperLU_4.3/lib/libsuperlu_4.3.a(sgssv.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib/SuperLU_4.3/lib/libsuperlu_4.3.a: error adding symbols: Bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libarmadillo.so.6.500.5] Error 1
make[1]: *** [CMakeFiles/armadillo.dir/all] Error 2
make: *** [all] Error 2
So I added the -fPIC flag to the SuperLU makefile and recompiled SuperLU, but then get a very slightly different error
Linking CXX shared library libarmadillo.so
/usr/bin/ld: /usr/lib/SuperLU_4.3/lib/libsuperlu_4.3.a(superlu_timer.o): relocation R_X86_64_PC32 against undefined symbol `sysconf##GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libarmadillo.so.6.500.5] Error 1
make[1]: *** [CMakeFiles/armadillo.dir/all] Error 2
make: *** [all] Error 2
I am not sure where to go from here. It seems that Armadillo expects to find SuperLU in a shared library format, wheras SuperLU installs itself as a static library. The version of Armdillo available in the package manager seems to be too out of date and does not have the features that I need.
Here are some of the Makefiles
Top Level Makefile for SuperLU
############################################################################
#
# Program: SuperLU
#
# Module: Makefile
#
# Purpose: Top-level Makefile
#
# Creation date: October 2, 1995
#
# Modified: February 4, 1997 Version 1.0
# November 15, 1997 Version 1.1
# September 1, 1999 Version 2.0
# October 15, 2003 Version 3.0
# August 1, 2008 Version 3.1
#
############################################################################
include make.inc
all: install lib testing
lib: superlulib tmglib
clean: cleanlib cleantesting
install:
( cd INSTALL; $(MAKE) )
# ( cd INSTALL; cp lsame.c ../SRC/; \
# cp dlamch.c ../SRC/; cp slamch.c ../SRC/ )
blaslib:
( cd CBLAS; $(MAKE) )
superlulib:
( cd SRC; $(MAKE) )
tmglib:
( cd TESTING/MATGEN; $(MAKE) )
matlabmex:
( cd MATLAB; $(MAKE) )
testing:
( cd TESTING ; $(MAKE) )
doc:
doxygen Doxyfile
cleanlib:
( cd SRC; $(MAKE) clean )
( cd TESTING/MATGEN; $(MAKE) clean )
( cd CBLAS; $(MAKE) clean )
cleantesting:
( cd INSTALL; $(MAKE) clean )
( cd TESTING; $(MAKE) clean )
( cd MATLAB; $(MAKE) clean )
( cd EXAMPLE; $(MAKE) clean )
( cd FORTRAN; $(MAKE) clean )
make.inc in SuperLU
############################################################################
#
# Program: SuperLU
#
# Module: make.inc
#
# Purpose: Top-level Definitions
#
# Creation date: October 2, 1995
#
# Modified: February 4, 1997 Version 1.0
# November 15, 1997 Version 1.1
# September 1, 1999 Version 2.0
#
############################################################################
#
# The machine (platform) identifier to append to the library names
#
PLAT = _linux
#
# The name of the libraries to be created/linked to
#
SuperLUroot = /usr/lib/SuperLU_4.3
SUPERLULIB = $(SuperLUroot)/lib/libsuperlu_4.3.a
#BLASLIB = $(SuperLUroot)/lib/libblas.a
## ATLAS BLAS causes single-precision to fail
#BLASDEF = -DUSE_VENDOR_BLAS
#BLASLIB = /usr/lib/libopenblas.a
## This BLAS causes single-precision to fail the test in SuperLU
# BLASDEF = -DUSE_VENDOR_BLAS
BLASLIB = ../lib/blas$(PLAT).a
TMGLIB = libtmglib.a
LIBS = $(SUPERLULIB) $(BLASLIB)
#
# The archiver and the flag(s) to use when building archive (library)
# If your system has no ranlib, set RANLIB = echo.
#
ARCH = ar
ARCHFLAGS = cr
RANLIB = ranlib
CC = gcc
CFLAGS = -O3 -fPIC
NOOPTS =
FORTRAN = g77
FFLAGS = -O2 -fPIC
LOADER = $(CC)
LOADOPTS = -fPIC
#
# C preprocessor defs for compilation for the Fortran interface
# (-DNoChange, -DAdd_, -DAdd__, or -DUpCase)
#
CDEFS = -DAdd_
#
# The directory in which Matlab is installed
#
MATLAB = /usr/local/MATLAB/R2015b
SRC/Makefile in SuperLU
# makefile for sparse supernodal LU, implemented in ANSI C
include ../make.inc
#######################################################################
# This is the makefile to create a library for SuperLU.
# The files are organized as follows:
#
# ALLAUX -- Auxiliary routines called from all precisions of SuperLU
# LAAUX -- LAPACK auxiliary routines called from all precisions
# SLASRC -- LAPACK single precision real routines
# DLASRC -- LAPACK double precision real routines
# CLASRC -- LAPACK single precision complex routines
# ZLASRC -- LAPACK double precision complex routines
# SCLAUX -- LAPACK Auxiliary routines called from both real and complex
# DZLAUX -- LAPACK Auxiliary routines called from both double precision
# and complex*16
# SLUSRC -- Single precision real SuperLU routines
# DLUSRC -- Double precision real SuperLU routines
# CLUSRC -- Single precision complex SuperLU routines
# ZLUSRC -- Double precision complex SuperLU routines
#
# The library can be set up to include routines for any combination
# of the four precisions. To create or add to the library, enter make
# followed by one or more of the precisions desired. Some examples:
# make single
# make single double
# make single double complex complex16
# Alternatively, the command
# make
# without any arguments creates a library of all four precisions.
# The library is called
# superlu.a
# and is created at the next higher directory level.
#
# To remove the object files after the library is created, enter
# make clean
#
#######################################################################
### LAPACK
LAAUX = lsame.o xerbla.o
SLASRC = slacon.o
DLASRC = dlacon.o
CLASRC = clacon.o scsum1.o icmax1.o
ZLASRC = zlacon.o dzsum1.o izmax1.o
SCLAUX = slamch.o
DZLAUX = dlamch.o
### SuperLU
ALLAUX = superlu_timer.o util.o memory.o get_perm_c.o mmd.o \
sp_coletree.o sp_preorder.o sp_ienv.o relax_snode.o \
heap_relax_snode.o colamd.o \
ilu_relax_snode.o ilu_heap_relax_snode.o mark_relax.o \
mc64ad.o qselect.o
SLUSRC = \
sgssv.o sgssvx.o \
ssp_blas2.o ssp_blas3.o sgscon.o \
slangs.o sgsequ.o slaqgs.o spivotgrowth.o \
sgsrfs.o sgstrf.o sgstrs.o scopy_to_ucol.o \
ssnode_dfs.o ssnode_bmod.o \
spanel_dfs.o spanel_bmod.o \
sreadhb.o sreadrb.o sreadtriple.o \
scolumn_dfs.o scolumn_bmod.o spivotL.o spruneL.o \
smemory.o sutil.o smyblas2.o \
sgsisx.o sgsitrf.o sldperm.o \
ilu_sdrop_row.o ilu_ssnode_dfs.o \
ilu_scolumn_dfs.o ilu_spanel_dfs.o ilu_scopy_to_ucol.o \
ilu_spivotL.o sdiagonal.o
DLUSRC = \
dgssv.o dgssvx.o \
dsp_blas2.o dsp_blas3.o dgscon.o \
dlangs.o dgsequ.o dlaqgs.o dpivotgrowth.o \
dgsrfs.o dgstrf.o dgstrs.o dcopy_to_ucol.o \
dsnode_dfs.o dsnode_bmod.o dpanel_dfs.o dpanel_bmod.o \
dreadhb.o dreadrb.o dreadtriple.o \
dcolumn_dfs.o dcolumn_bmod.o dpivotL.o dpruneL.o \
dmemory.o dutil.o dmyblas2.o \
dgsisx.o dgsitrf.o dldperm.o \
ilu_ddrop_row.o ilu_dsnode_dfs.o \
ilu_dcolumn_dfs.o ilu_dpanel_dfs.o ilu_dcopy_to_ucol.o \
ilu_dpivotL.o ddiagonal.o
## dgstrsL.o dgstrsU.o
CLUSRC = \
scomplex.o cgssv.o cgssvx.o csp_blas2.o csp_blas3.o cgscon.o \
clangs.o cgsequ.o claqgs.o cpivotgrowth.o \
cgsrfs.o cgstrf.o cgstrs.o ccopy_to_ucol.o \
csnode_dfs.o csnode_bmod.o \
cpanel_dfs.o cpanel_bmod.o \
creadhb.o creadrb.o creadtriple.o \
ccolumn_dfs.o ccolumn_bmod.o cpivotL.o cpruneL.o \
cmemory.o cutil.o cmyblas2.o \
cgsisx.o cgsitrf.o cldperm.o \
ilu_cdrop_row.o ilu_csnode_dfs.o \
ilu_ccolumn_dfs.o ilu_cpanel_dfs.o ilu_ccopy_to_ucol.o \
ilu_cpivotL.o cdiagonal.o
ZLUSRC = \
dcomplex.o zgssv.o zgssvx.o zsp_blas2.o zsp_blas3.o zgscon.o \
zlangs.o zgsequ.o zlaqgs.o zpivotgrowth.o \
zgsrfs.o zgstrf.o zgstrs.o zcopy_to_ucol.o \
zsnode_dfs.o zsnode_bmod.o \
zpanel_dfs.o zpanel_bmod.o \
zreadhb.o zreadrb.o zreadtriple.o \
zcolumn_dfs.o zcolumn_bmod.o zpivotL.o zpruneL.o \
zmemory.o zutil.o zmyblas2.o \
zgsisx.o zgsitrf.o zldperm.o \
ilu_zdrop_row.o ilu_zsnode_dfs.o \
ilu_zcolumn_dfs.o ilu_zpanel_dfs.o ilu_zcopy_to_ucol.o \
ilu_zpivotL.o zdiagonal.o
all: single double complex complex16
single: $(SLUSRC) $(ALLAUX) $(LAAUX) $(SLASRC) $(SCLAUX)
$(ARCH) $(ARCHFLAGS) $(SUPERLULIB) \
$(SLUSRC) $(ALLAUX) $(LAAUX) $(SLASRC) $(SCLAUX)
$(RANLIB) $(SUPERLULIB)
double: $(DLUSRC) $(ALLAUX) $(LAAUX) $(DLASRC) $(DZLAUX)
$(ARCH) $(ARCHFLAGS) $(SUPERLULIB) \
$(DLUSRC) $(ALLAUX) $(LAAUX) $(DLASRC) $(DZLAUX)
$(RANLIB) $(SUPERLULIB)
complex: $(CLUSRC) $(ALLAUX) $(LAAUX) $(CLASRC) $(SCLAUX)
$(ARCH) $(ARCHFLAGS) $(SUPERLULIB) \
$(CLUSRC) $(ALLAUX) $(LAAUX) $(CLASRC) $(SCLAUX)
$(RANLIB) $(SUPERLULIB)
complex16: $(ZLUSRC) $(ALLAUX) $(LAAUX) $(ZLASRC) $(DZLAUX)
$(ARCH) $(ARCHFLAGS) $(SUPERLULIB) \
$(ZLUSRC) $(ALLAUX) $(LAAUX) $(ZLASRC) $(DZLAUX)
$(RANLIB) $(SUPERLULIB)
##################################
# Do not optimize these routines #
##################################
slamch.o: slamch.c ; $(CC) -c $(NOOPTS) $(CDEFS) $<
dlamch.o: dlamch.c ; $(CC) -c $(NOOPTS) $(CDEFS) $<
superlu_timer.o: superlu_timer.c ; $(CC) -c $(NOOPTS) $<
##################################
.c.o:
$(CC) $(CFLAGS) $(CDEFS) $(BLASDEF) -c $< $(VERBOSE)
.f.o:
$(FORTRAN) $(FFLAGS) -c $<
clean:
rm -f *.o $(SUPERLULIB)
Armadillo Makefile generated by CMake
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 2.8
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =
.SUFFIXES: .hpux_make_needs_suffix_list
# Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E remove -f
# Escaping for special characters.
EQUALS = =
# The program to use to edit the cache.
CMAKE_EDIT_COMMAND = /usr/bin/cmake-gui
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /home/daniel/Downloads/armadillo-6.500.5
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /home/daniel/Downloads/armadillo-6.500.5
#=============================================================================
# Targets provided globally by CMake.
# Special rule for the target edit_cache
edit_cache:
#$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
/usr/bin/cmake-gui -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : edit_cache
# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast
# Special rule for the target install
install: preinstall
#$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
/usr/bin/cmake -P cmake_install.cmake
.PHONY : install
# Special rule for the target install
install/fast: preinstall/fast
#$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
/usr/bin/cmake -P cmake_install.cmake
.PHONY : install/fast
# Special rule for the target install/local
install/local: preinstall
#$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local
# Special rule for the target install/local
install/local/fast: install/local
.PHONY : install/local/fast
# Special rule for the target list_install_components
list_install_components:
#$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\" \"dev\""
.PHONY : list_install_components
# Special rule for the target list_install_components
list_install_components/fast: list_install_components
.PHONY : list_install_components/fast
# Special rule for the target rebuild_cache
rebuild_cache:
#$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache
# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast
# The main all target
all: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /home/daniel/Downloads/armadillo-6.500.5/CMakeFiles /home/daniel/Downloads/armadillo-6.500.5/CMakeFiles/progress.marks
$(MAKE) -f CMakeFiles/Makefile2 all
$(CMAKE_COMMAND) -E cmake_progress_start /home/daniel/Downloads/armadillo-6.500.5/CMakeFiles 0
.PHONY : all
# The main clean target
clean:
$(MAKE) -f CMakeFiles/Makefile2 clean
.PHONY : clean
# The main clean target
clean/fast: clean
.PHONY : clean/fast
# Prepare targets for installation.
preinstall: all
$(MAKE) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall
# Prepare targets for installation.
preinstall/fast:
$(MAKE) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall/fast
# clear depends
depend:
$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend
#=============================================================================
# Target rules for targets named armadillo
# Build rule for target.
armadillo: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 armadillo
.PHONY : armadillo
# fast build rule for target.
armadillo/fast:
$(MAKE) -f CMakeFiles/armadillo.dir/build.make CMakeFiles/armadillo.dir/build
.PHONY : armadillo/fast
# Manual pre-install relink rule for target.
armadillo/preinstall:
$(MAKE) -f CMakeFiles/armadillo.dir/build.make CMakeFiles/armadillo.dir/preinstall
.PHONY : armadillo/preinstall
src/wrapper.o: src/wrapper.cpp.o
.PHONY : src/wrapper.o
# target to build an object file
src/wrapper.cpp.o:
$(MAKE) -f CMakeFiles/armadillo.dir/build.make CMakeFiles/armadillo.dir/src/wrapper.cpp.o
.PHONY : src/wrapper.cpp.o
src/wrapper.i: src/wrapper.cpp.i
.PHONY : src/wrapper.i
# target to preprocess a source file
src/wrapper.cpp.i:
$(MAKE) -f CMakeFiles/armadillo.dir/build.make CMakeFiles/armadillo.dir/src/wrapper.cpp.i
.PHONY : src/wrapper.cpp.i
src/wrapper.s: src/wrapper.cpp.s
.PHONY : src/wrapper.s
# target to generate assembly for a file
src/wrapper.cpp.s:
$(MAKE) -f CMakeFiles/armadillo.dir/build.make CMakeFiles/armadillo.dir/src/wrapper.cpp.s
.PHONY : src/wrapper.cpp.s
# Help Target
help:
#echo "The following are some of the valid targets for this Makefile:"
#echo "... all (the default if no target is provided)"
#echo "... clean"
#echo "... depend"
#echo "... armadillo"
#echo "... edit_cache"
#echo "... install"
#echo "... install/local"
#echo "... list_install_components"
#echo "... rebuild_cache"
#echo "... src/wrapper.o"
#echo "... src/wrapper.i"
#echo "... src/wrapper.s"
.PHONY : help
#=============================================================================
# Special targets to cleanup operation of make.
# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system
Please let me know what I should try. I am not very experienced with compiling/linking libraries on Linux, so please provide details if possible. Thank you.
Had the same problem, looks like the superlu_timer.c is not compiled with -fPIC even when you set it in the CFLAGS
For some reason the guys behind SuperLU didn't want to optimize that file, so they set a specific target in the Makefile of the SRC folder for this single file
You can see it in SuperLU_4.3/SRC/Makefile:
##################################
# Do not optimize these routines #
##################################
slamch.o: slamch.c ; $(CC) -c $(NOOPTS) $(CDEFS) $<
dlamch.o: dlamch.c ; $(CC) -c $(NOOPTS) $(CDEFS) $<
superlu_timer.o: superlu_timer.c ; $(CC) -c $(NOOPTS) $<
##################################
The solution was to change the superlu_timer.o line to include -fPIC:
superlu_timer.o: superlu_timer.c ; $(CC) -fPIC -c $(NOOPTS) $<
After that, just do make clean and make to generate the library again

What tool do you use to build an Erlang program?

What tool do you use to build an Erlang program: Emake, makiefile or another?
Since these answers, a new standard has emerged in the Erlang community:
Rebar
https://github.com/basho/rebar/
We use a similar Emakefile as well.
{"src/*", [debug_info, {outdir, "ebin"}, {i, "include"}]}.
I use the erlang make functionality to run tests after succesful compilation.
Makefile extract:
all: compile
compile:
erlc -o ebin +debug_info erl_make.erl
erl -pa ./ebin -eval "erl_make:make(development)" -s init stop -noshell
erl_make.erl
-module(erl_make).
-export([make/1]).
make(Mode) ->
case make:all([{d, Mode}]) of
error ->
error;
_ ->
test_suite:test()
end.
I use a Rakefile calling an Emakefile.
Rakefile for flexibility and Emakefile for speed !
This build system is quite powerful, see erl_rake on GitHub
Generates .app files, builds releases automatically, runs EUnit test.
And given it's build around a Rakefile, I've added easily pushing release to AWS and run my tests with etap instead.
I customized an old version on for my github projects.
Here is the Makefile and Emakefile I usually use with make (origin unknown).
Makefile:
ERL=erl
APPFILE=myApp.app
all: ebin/$(APPFILE)
$(ERL) -make
ebin/$(APPFILE): src/$(APPFILE)
cp $< $#
Emakefile:
{"src/*", [debug_info, {outdir, "ebin"}, {i, "include"}]}.
I propose my own tool :) Eake ... is very similar to rake from Ruby environment:
http://github.com/andrzejsliwa/eake
or
http://andrzejsliwa.com/2009/05/28/eake-narzedzie-budowania-dla-erlanga-bazujace-na-rake/
Here is example eakefile
-module(eakefile).
-compile([export_all]).
-import(eake, [task/3, namespace/3, run_target/2, run/1]).
execute() -> [
namespace(db, "test", [
task(migrate, "That is migration", fun(Params) ->
io:format("in migration params: ~w", [Params]),
run_target('db:rollback', [])
end),
task(rollback, "That is rollback", fun(_) ->
io:format("in rollback"),
run("ls")
end)
])
].
and this is example using:
$ eake db:migrate
$ eake db:migrate db:rollback
$ eake db:migrate=[1,atom]
$ eake db:migrate=name
Use Sinan for building and Faxien for installing! Check out erlware.org. They are way better than a make file and provide ease of distribution. They are both in heavy active development and will be featured in: http://www.manning.com/logan/
You can check my Makefiles, i took them from mochiweb or something like that.
Sorry but code have some project-specified parts
http://github.com/JLarky/eadc-hub/blob/master/Makefile
MARKDOWN_SOURCES=$(wildcard doc/*.md)
MARKDOWN_TARGETS=$(patsubst doc/%.md,doc/html/%.html,$(MARKDOWN_SOURCES))
all: eadc boot deps
eadc: ebin
cd src && $(MAKE)
deps:
(cd deps/somedeps;$(MAKE);)
docs: erlang-docs # html-docs
erlang-docs: doc/edoc
(cd src;$(MAKE) docs)
html-docs: doc/html $(MARKDOWN_TARGETS)
doc/edoc:
mkdir -p doc/edoc
doc/html:
mkdir -p doc/html
doc/html/%.html: doc/%.md
(title=`grep '^# ' $ $# ;\
python doc/buildtoc.py $$t ;\
markdown $$t >> $# ;\
rm $$t ;\
cat doc/footer.html >> $#)
ebin:
mkdir -p ebin
clean: clean-docs
(cd src;$(MAKE) clean)
(cd deps/*/; $(MAKE) clean)
$(RM) -r priv
$(RM) ebin/*.boot ebin/*.script ebin/*crash.dump ebin/*~ src/*~ priv/*~ *~ \#*\#
clean-docs: clean-html
$(rm) -rf doc/edoc
clean-html:
rm -rf doc/html
boot: ebin/eadc.boot
ebin/eadc.boot: ebin/eadc.rel ebin/eadc.app
erl -pa ebin -noshel -run eadc_utils make_script -run erlang halt
cleandb:
$(RM) -r ebin/Mnesia*
http://github.com/JLarky/eadc-hub/blob/master/support/include.mk
## -*- makefile -*- ## Erlang
ERL := erl
ERLC := $(ERL)c
INCLUDE_DIRS := ../include $(wildcard ../deps/*/include)
EBIN_DIRS := $(wildcard ../deps/*/ebin)
ERLC_FLAGS := -W $(INCLUDE_DIRS:../%=-I ../%) $(EBIN_DIRS:%=-pa %)
ifndef no_debug_info
ERLC_FLAGS += +debug_info
endif
ifdef debug
ERLC_FLAGS += -Ddebug
endif
EBIN_DIR := ../ebin
DOC_DIR := ../doc/edoc
EMULATOR := beam
ERL_SOURCES := $(wildcard *.erl)
ERL_HEADERS := $(wildcard *.hrl) $(wildcard ../include/*.hrl)
ERL_OBJECTS := $(ERL_SOURCES:%.erl=$(EBIN_DIR)/%.$(EMULATOR))
ERL_DOCUMENTS := $(ERL_SOURCES:%.erl=$(DOC_DIR)/%.html)
ERL_OBJECTS_LOCAL := $(ERL_SOURCES:%.erl=./%.$(EMULATOR))
APP_FILES := $(wildcard *.app)
REL_FILES := $(wildcard *.rel)
EBIN_FILES_NO_DOCS = $(ERL_OBJECTS) $(APP_FILES:%.app=../ebin/%.app) $(REL_FILES:%.rel=../ebin/%.rel)
EBIN_FILES = $(ERL_DOCUMENTS) $(EBIN_FILES_NO_DOCS)
MODULES = $(ERL_SOURCES:%.erl=%)
../ebin/%.app: %.app
cp $
http://github.com/JLarky/eadc-hub/blob/master/src/Makefile
include ../support/include.mk
all: $(EBIN_FILES_NO_DOCS)
docs: $(ERL_DOCUMENTS)
*emphasized text*
debug:
$(MAKE) DEBUG=-DDEBUG
clean:
rm -rf $(EBIN_FILES) $(PLUGINS_OBJECTS)