From owner-freebsd-questions@FreeBSD.ORG Thu Jul 30 07:13:00 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CCCA106564A for ; Thu, 30 Jul 2009 07:13:00 +0000 (UTC) (envelope-from ml@netfence.it) Received: from cp-out10.libero.it (cp-out10.libero.it [212.52.84.110]) by mx1.freebsd.org (Postfix) with ESMTP id E315C8FC18 for ; Thu, 30 Jul 2009 07:12:59 +0000 (UTC) (envelope-from ml@netfence.it) Received: from soth.ventu (151.51.52.29) by cp-out10.libero.it (8.5.107) id 4A5DDB5B0182CDFD for freebsd-questions@freebsd.org; Thu, 30 Jul 2009 09:01:49 +0200 Received: from alamar.ventu (alamar.ventu [10.1.2.18]) by soth.ventu (8.14.3/8.14.2) with ESMTP id n6U71mBT073801 for ; Thu, 30 Jul 2009 09:01:49 +0200 (CEST) (envelope-from ml@netfence.it) Message-ID: <4A71455C.2070506@netfence.it> Date: Thu, 30 Jul 2009 09:01:48 +0200 From: Andrea Venturoli User-Agent: Thunderbird 2.0.0.22 (X11/20090624) MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: OpenMP X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 07:13:00 -0000 Hello. I'm trying to use OpenMP in C++ on FreeBSD 6.3p10/i386 and I'm totally stuck. First off, base system's gcc (3.4.6) does not include OpenMP support, so I'm using gcc 4.2.5 from ports (I also tried 4.3.4, but that does not make much difference). I've added the flag -fopenmp to the command line: this enables parsing of #pragma omp directives, but results in undefined references at compilation time. So I also added -lgomp (although Google suggests it should be automatically picked up). Now the program compiles and links fine, but at runtime, as soon as the "#pragma"ed function is called, I get again undefined references (to GOMP_parallel_start, GOMP_parallel_end, omp_get_num_threads and omp_get_thread_num). I tried removing the #pragmas (so OpenMP is not used, altough enabled and linked in), and so I get "Bad system call (core dumped)" at runtime. gdb tells me this happens in ksem_init and Google again helps by telling me I need to put "options P1003_1B_SEMAPHORES" (from NOTES) in my kernel config, or kldload sem. The problem is, all these messages are very old: _ "kldload sem" results in "No such file or directory"; _ a sysvsem.ko exists in /boot/kernel, but "kldload sysvsem" results in "File exists" (I have in fact "options SYSVSEM" in my kernel config); _ my system's NOTES bears no mention of P1003_1B_SEMAPHORES; _ man sem still reports "FreeBSD 6.2" at the bottom. So I was wondering if these suggestions are still valid, or if something changed before 6.3 was released; on the other hand, is 6.3 too old and would upgrading to some newer version solve this matter? Any other hint or info is appreciated. bye & Thanks av.