All of lore.kernel.org
 help / color / mirror / Atom feed
From: Erik Sommer <erik.sommer@domain.hid>
To: xenomai@xenomai.org
Subject: [Xenomai-help] can't link math.h in a userspace programm
Date: Wed, 23 Nov 2011 10:38:49 +0100	[thread overview]
Message-ID: <1322041129.15019.7.camel@domain.hid> (raw)

Hello,

I'm programming a userspace Xenomai-Programm für a Xilinx PowerPC
(additional Information without FPU). I include the math.h because I
have to use arcustangens and arcuscosinus. When compiling the programm
it seems so like the linker can't do his job for math.h.

minimal example:

"
#include <stdbool.h>// boolescher Datentyp
#include <native/task.h>
#include <native/timer.h>
#include <rtdm/rtdm.h>
#include <sys/mman.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <math.h>

void user_task(void *cookie){
...
Vektor.y_w=0.5*atan(Vektor.y/reg->l_O);
...
}
"

the Makefile:

"
# Name der zu erstellenden Programmdatei
PROG=pu10_Las_Vek

# Liste der C-Dateien im Verzeichnis
C_DAT=$(wildcard *.c)


# Variablen für die Benutzung des ELDK-Compilers
ARCH=powerpc

#Xenomai Installations Pfad
DESTDIR=../usersupport/root
#DESTDIR=/mnt/albatros_projekte/PU10/pu10_sw/PU10_Xenomai/xenomai_build/root
XENO := $(DESTDIR)/usr/xenomai

XENOCONFIG=$(shell PATH=$(XENO):$(XENO)/bin:$(PATH) which xeno-config
2>/dev/null)

CC=$(shell $(XENOCONFIG) --cc)

CFLAGS=$(shell export DESTDIR="$(DESTDIR)"; $(XENOCONFIG) --skin native
--cflags) $(MY_CFLAGS)

LDFLAGS=$(shell export DESTDIR="$(DESTDIR)"; $(XENOCONFIG) --skin native
--ldflags) $(MY_LDFLAGS) -lnative -lrtdm

#Xenomai Library Pfad in binary hinzufügen
LPATH=/usr/xenomai/lib
#LDFLAGS+=-Xlinker -rpath -Xlinker $(shell $(XENOCONFIG) --libdir)
LDFLAGS+=-Xlinker -rpath -Xlinker $(LPATH) 

$(PROG):: 
	$(CC) -Wall $(CFLAGS) $(LDFLAGS) -L/usr/lib -I/usr/include
$(C_DAT) ../defines.h ../regbank.h -o $(PROG)	

clean::
	$(RM) $(PROG) *.o
"

I hope for some hints.

Erik 





             reply	other threads:[~2011-11-23  9:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23  9:38 Erik Sommer [this message]
2011-11-25 13:06 ` [Xenomai-help] can't link math.h in a userspace programm Robert
2011-11-25 13:33   ` Erik Sommer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1322041129.15019.7.camel@domain.hid \
    --to=erik.sommer@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.