I'm trying to compile gdis on osx el capitan.
Downloaded the gdis version available from developer, but once i click the executable of the release version, nothing happens.
So, i've followed the developer instructions, compiling CVS and Perl (from homebrew), to get the development version, executing this from terminal:
Blockquote
cvs -d:pserver:anonymous#gdis.cvs.sourceforge.net:/cvsroot/gdis login
Hit enter at the password prompt, then type:
cvs -z3 -d:pserver:anonymous#gdis.cvs.sourceforge.net:/cvsroot/gdis co gdis
which should create a folder called gdis containing all the source files.
Enter the gdis subdirectory and run the install script, which should automatically compile gdis based on your preferences.
It should also inform you of missing libraries that must be installed.
Blockquote
running the install script, which is inside Macintosh HD/Users/nBogoni/gdis, it renders the following message:
Checking pre-requisite packages.
gtk+-2.0 [ok]
gtkglext-1.0 [ok]
Compiling [gdis] ... [failed] check install.log
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
[Process completed]
Checking the install.log file, it says:
Must specify package names on the command line
makefile:4: makefile.osx: No such file or directory
makefile:5: makefile.src: No such file or directory
makefile:18: makefile.other: No such file or directory
make: *** No rule to make target `makefile.other'. Stop.
This is what I have inside the makefile.osx, inside Macintosh HD/Users/nBogoni/gdis
# --- gdis Makefile for OS-X
CC = gcc
#CFLAGS = -O2 -no-cpp-precomp
CFLAGS = -O2
INCS := $(INCS) -I/System/Library/Frameworks/OpenGL.framework/Headers
LIBS := $(LIBS) -L/System/Library/Frameworks/OpenGL.framework/Libraries
inside the makefile.src on gdis folder, inside Macintosh HD/Users/nBogoni/gdis
# --- gdis Makefile sources
SRC = main.c model.c coords.c connect.c matrix.c task.c \
type.c measure.c parse.c edit.c elem.c select.c surface.c \
analysis.c spatial.c render.c numeric.c project.c grid.c \
molsurf.c hirshfeld.c zone.c contents.c quaternion.c zmatrix.c \
library.c geometry.c space.c sginfo.c sgclib.c sgio.c error.c \
scan.c camera.c defect.c colourlib.c mdi.c \
mesch.c mesch_core.c host.c command.c undo.c count.c \
ff.c ff_gulp.c scalar.c animate.c test.c \
file.c file_cif.c file_gulp.c file_gmf.c file_marvin.c file_xtl.c \
file_arc.c file_xyz.c file_siesta.c file_gms.c file_diff.c file_xml.c \
file_abinit.c file_pdb.c file_povray.c file_nwchem.c file_castep.c \
file_gauss.c file_rietica.c file_geomview.c file_cssr.c file_cel.c \
file_dmol.c file_dlpoly.c file_bgf.c file_cgf.c file_dlp.c \
file_gromacs.c file_meta.c file_aims.c file_gauss_cube.c \
file_pwscf.c file_xsf.c file_openmx.c file_reaxmd.c \
import.c graph.c grisu_client.c
ifeq ($(USE_GUI), YES)
SRC := $(SRC) gui_main.c gui_canvas.c gui_shorts.c \
gl_main.c gl_primitives.c gl_stereo.c gl_graph.c gl_varray.c \
gui_gulp.c gui_siesta.c gui_render.c gui_mdi.c gui_animate.c \
gui_edit.c gui_surface.c gui_analysis.c gui_defect.c gui_nwchem.c \
gui_molsurf.c gui_diffract.c gui_gms.c gui_library.c gui_setup.c \
gui_gperiodic.c gui_space.c gui_measure.c gui_symmetry.c gui_zmatrix.c \
gui_dialog.c gui_tree.c gui_task.c gui_help.c gui_job.c \
dock.c image.c gui_grid.c gui_project.c
endif
ifeq ($(USE_GRISU), YES)
SRC := $(SRC) stdsoap2.c soapC.c soapClient.c logging.c grid_certificates.c \
py_login.c
# jni_grisu.c
endif
and the makefile.other, also inside Macintosh HD/Users/nBogoni/gdis
.PHONY: clean
clean:
/bin/rm -f $(OBJ) gdis
/bin/rm -fr gdis.app
/bin/rm -f gdis.dmg
.PHONY: tgz
tgz:
tar -czvf gdis-source.tgz \
install makefile makefile.* \
README CHANGELOG TODO GPL.txt gdis.manual gdis.elements gdis.library \
*.c *.h *.xpm grisu.wsdl grisu*.nsmap;
.PHONY: zip
zip:
zip gdis-source.zip \
install makefile makefile.* \
README CHANGELOG TODO GPL.txt gdis.manual gdis.elements gdis.library \
*.c *.h *.xpm grisu.wsdl grisu*.nsmap;
.PHONY: binzip
binzip:
zip -r gdis-bin.zip \
gdis gdis.elements gdis.library gdis.manual lib/init.jar lib/sggc.jar
Could someone help me solving this, since I'm new to mac terminal.
Thanks a lot!
Well, to this problem, the solution I found was to run the following command inside the installation directory.
./install all
Than with that, the install file could locate the makefiles.
Thanks anyway, even if no one got interested in helping me.
Related
I am using automake to build my project. My project uses pthread and libsocketcan. I have installed libsocketcan with the command
sudo apt-get install libsocketcan-dev
In eclpise I have added linker flags for pthread and libsocketcan. The code will compile and run. When I run my automake script the build fails with the error.
gcc: error: unrecognized command line option ‘-socketcan’[![enter image description here][1]][1]
My makefile.am is as follows:
AUTOMAKE_OPTIONS = foreign subdir-objects
bin_PROGRAMS = MAIN_Application
LDFLAGS = \
-pthread \
-socketcan
AM_CPPFLAGS = \
-I$(srcdir)/include \
-I$(srcdir)/include/utilities \
-I$(srcdir)/include/comms
MAIN_Application_SOURCES = \
src/main.c \
src/scheduler.c \
src/utilities/time_conversions.c \
src/utilities/ring_buffer.c \
src/utilities/logger.c \
src/comms/can.c
If I remove all code and references here to socketcan, everything works fine. I get a nice application binary that can run threads. Once I add can I can no longer build. I have tried with the LDFLAGS socketcan, libsocketcan and libsocketcan-dev.
What LDFLAG do I need in my makefile to properly include libsocketcan?
You do not need any "LDFLAG" for this. LDFLAGS is for linker flags, not for adding libraries to link to.
You can have MAIN_Application link against libsocketcan with something like:
MAIN_Application_LDADD = -lsocketcan
I am currently building a cross-compiler targeting the PowerPC architecture. It is capable of building Linux binaries that work and can execute on the target, however I hit a problem when I enable the compiler flag "-D_FORTIFY_SOURCE=2". I build a simple hello world application as so:
#include <limits.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
return 0;
}
I compile this using my cross-compiler and get the following error:
$ powerpc-linux-gnu-gcc -D_FORTIFY_SOURCE=2 -O2 hello.c
In file included from /opt/crossgcc/powerpc-linux-gnu/include/stdlib.h:958:0,
from hello.c:2:
/opt/crossgcc/powerpc-linux-gnu/include/bits/stdlib.h: In function 'wctomb':
/opt/crossgcc/powerpc-linux-gnu/include/bits/stdlib.h:90:3: error: #error "Assumed value of MB_LEN_MAX wrong"
# error "Assumed value of MB_LEN_MAX wrong"
^
I believe this is because I am not bootstrapping my GCC build correctly, but as far as I can see I am building it correctly. The script I am taking to build my compiler are as follows:
#! /bin/bash
set -e
INSTALL_PATH=$PWD/output
TARGET=powerpc-linux-gnu
LINUX_ARCH=powerpc
PARALLEL_MAKE=-j4
BINUTILS_VERSION=binutils-2.32
GCC_VERSION=gcc-8.3.0
LINUX_KERNEL_VERSION=linux-5.1.9
GLIBC_VERSION=glibc-2.29
export PATH=$INSTALL_PATH/bin:$PATH
cd $GCC_VERSION
./contrib/download_prerequisites
cd ..
mkdir -p build-binutils
cd build-binutils
../$BINUTILS_VERSION/configure --prefix=$INSTALL_PATH --target=$TARGET
make $PARALLEL_MAKE
make install
cd ..
cd $LINUX_KERNEL_VERSION
make ARCH=$LINUX_ARCH INSTALL_HDR_PATH=$INSTALL_PATH/$TARGET headers_install
cd ..
# Build GCC compiler
mkdir -p build-gcc
cd build-gcc
../$GCC_VERSION/configure \
--prefix=$INSTALL_PATH \
--target=$TARGET \
--disable-silent-rules \
--with-gnu-as --with-gnu-ld \
--enable-languages="c,c++" \
--enable-theads=posix \
--enable-c99 \
--enable-long-long \
--enable-lto \
--enable-libssp \
--enable-secureplt \
--disable-libmudflag \
--enable-secureplt \
--disable-nls \
--with-long-double-128
make $PARALLEL_MAKE all-gcc
make install-gcc
cd ..
mkdir -p build-glibc
cd build-glibc
../$GLIBC_VERSION/configure \
--prefix=$INSTALL_PATH/$TARGET \
--build=$(gcc -dumpmachine) \
--host=$TARGET \
--target=$TARGET \
--with-headers=$INSTALL_PATH/$TARGET/include \
libc_cv_forced_unwind=yes
make install-bootstrap-headers=yes install-headers
make $PARALLEL_MAKE csu/subdir_lib
install csu/crt1.o csu/crti.o csu/crtn.o $INSTALL_PATH/$TARGET/lib
$TARGET-gcc -nostdlib -nostartfiles -shared -x c /dev/null -o $INSTALL_PATH/$TARGET/lib/libc.so
touch $INSTALL_PATH/$TARGET/include/gnu/stubs.h
cd ..
cd build-gcc
make $PARALLEL_MAKE all-target-libgcc
make install-target-libgcc
cd ..
cd build-glibc
make $PARALLEL_MAKE
make install
cd ..
cd build-gcc
make $PARALLEL_MAKE all
make install
cd ..
Am I incorrectly bootstrapping my GCC? Should I be doing something differently to make GCC "aware" of my glibc headers?
By default the limits.h file is not properly configured, so you need to patch it.
To fix the problem you have to go inside GCC's source directory and type the command:
cd $GCC_VERSION
cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \
`dirname $(${TARGET}-gcc -print-libgcc-file-name)`/include-fixed/limits.h
This adds a #include_next <limits.h> to the bottom which eventually picks up the right header.
Quickly adding to Anthony, to complete the debugging do not forget at the end of this step to use:
$LFS/tools/libexec/gcc/$LFS_TGT/10.2.0/install-tools/mkheaders
I am adding a module apps/trace.c to be compiled into the openssl programs when building the OpenSSL library. The purpose is save a trace list of function calls using the gcc -finstrument-functions compile option, as described
here
Actually, I have succeeded by modifying the automatically generated "Makefile" by hand, adding in trace.o as follows:
apps/openssl: apps/trace.o apps/app_rand.o apps/apps.o ...
$(RM) apps/openssl
$(MAKE) -f $(SRCDIR)/Makefile.shared -e \
PERL="$(PERL)" SRCDIR=$(SRCDIR) \
APPNAME=apps/openssl OBJECTS="apps/trace.o apps/app_rand.o apps/apps.o ..." \
LIBDEPS='$(PLIB_LDFLAGS) '" -L. -lssl -L. -lcrypto"' $(EX_LIBS)' \
CC='$(CC)' CFLAGS='$(CFLAGS) $(BIN_CFLAGS)' \
LDFLAGS='$(LDFLAGS)' \
link_app.
However, then next time configure is run, the manual change will be overwritten when the Makefile is again automatically generated.
I am not quite sure how to configure the trace object file into the compilation at a higher level. That is my question.
With Yocto 1.8 (fido), I am using a simple yocto recipe to run a Makefile.
SUMMARY = "PCI kernel module"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=4a0f8ad6a793571b331b0e19e3dd925c"
inherit module
PR = "r0"
PV = "1.0"
SRC_URI = "file://Makefile \
file://COPYING \
file://code.c \
file://code.h \
"
S = "${WORKDIR}"
And here is the Makefile.
obj-m := code.o
SRC := $(shell pwd)
all:
$(MAKE) -C $(KERNEL_SRC) M=$(SRC)
modules_install:
$(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
clean:
rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
rm -f Module.markers Module.symvers modules.order
rm -rf .tmp_versions Modules.symvers
When running bitbake on this recipe, I get the following compilation errors.
error: no include path in which to search for stdint.h
| # include_next <stdint.h>
| ^
How do I configure this recipe to include gcc when compiling?
What does does your code.c look like?
You can't use userspace headers in a module, and as far as I know, stdint.h is header from userspace.
i think that is toolchain problem
if your files are .c file use ${CC} in make file to compile in yocto.
files are .cpp use ${CXX} in make file
then it will compile with yocto default toolchain
When I run 'make', in a project with autotools and libtool, the library is builded correctly, but the executable is not created in its path. This is the line generated by automake:
/bin/bash ../libtool --tag=CXX --mode=link g++ -g -O0 -o foo foo-foo.o ../libfoo/src/libfoo.la
This line doesn't print anything (even errors). There is something wrong with this Makefile.am?
bin_PROGRAMS=foo
foo_SOURCES= \
foo.cc
foo_CPPFLAGS = \
-I$(top_srcdir)/libfoo/include \
-DLOCALEDIR=\"$(localedir)\"
foo_LDADD = \
../libfoo/src/libfoo.la \
$(LIBINTL)