New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

Start a Discussion

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

OpenMp and XCode 3.1.2 link pb

Post Reply New Thread Subscribe

Thread Tools

Member Since: Jul 01, 2009
Posts: 1
Pylou is on a distinguished road

Pylou is offline

I am trying to compile the following c code with GCC 4.2 using XCode :

#include <omp.h>
#include <stdio.h>

void main(){

int nthreads, tid, NumberOfProcs;

NumberOfProcs = omp_get_num_procs();
printf("\nWorking on %d Processors",NumberOfProcs);


#pragma omp parallel private(tid)
tid = omp_get_thread_num();
printf("\nWoohoo from thread : %d", tid);
if (tid==0){
nthreads = omp_get_num_threads();
printf("\nMaster says : There is %d out there!", nthreads);
// No more threads
In the project settings I have selected GCC 4.2 and the -fopenmp link option is set by default. Anyway, building with XCode I get errors at link with all openmp routines that cannot be found...

With the following standard Makefile process on my MACPro I have absolutely no such error at link...

CC = /usr/bin/gcc-4.2
CFLAGS = -W -Wall -O3 -fopenmp
LDFLAGS = -fopenmp

SRC = $(wildcard *.c)
OBJS = $(SRC:.c=.o)
AOUT = OpenTest

all : $(AOUT)

OpenTest : $(OBJS)
$(CC) $(LDFLAGS) -o $@ $^

%.o : %.c
$(CC) $(CFLAGS) -o $@ -c $<

clean :
@rm *.o
Any idea to make XCode correctly found the appropriate libs?
Is that possible to show XCode Makefile ?
QUOTE Thanks

Post Reply New Thread Subscribe

« Objective C call main method | Webobject problem: [java.lang.NullPointerException] null:<WOApplication>: Cannot be i »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

All times are GMT -4. The time now is 06:33 PM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.

Welcome to

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!

(4 digit year)

Already a member?