CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Problem with Compiling UDFs in Ansys Fluent 13 (lnx64) (http://www.cfd-online.com/Forums/fluent-udf/92412-problem-compiling-udfs-ansys-fluent-13-lnx64.html)

Ali.beh September 13, 2011 14:26

Problem with Compiling UDFs in Ansys Fluent 13 (lnx64)
 
Hi

I am running Ansys Fluent 13.0 (lnx64) under Opensuse 11.4 (64bit). I have GCC 4.5 installed on my machine however I cannot compile any kind of UDFs (Even examples available in UDF Manual). I can interpret UDFs but for some reasons I have to use a macro that can be used only as a compiled UDF. Here is my log file:
================================================== ======
for d in lnamd64/[23]*; do \
( \
cd $d; \
for f in ../../src/*.[ch] ../../src/makefile; do \
if [ ! -f `basename $f` ]; then \
echo "# linking to" $f "in" $d; \
ln -s $f .; \
fi; \
done; \
echo ""; \
echo "# building library in" $d; \
if [ "" = "1" ]; then \
echo "# using gcc64"; \
make ARCHC=gcc64 -k>makelog 2>&1; \
else \
if [ "" = "1" ]; then \
echo "# using gcc"; \
make ARCHC=gcc -k>makelog 2>&1; \
else \
make -k>makelog 2>&1; \
fi; \
fi;\
cat makelog; \
) \
done

# building library in lnamd64/2ddp
make[1]: Entering directory `/home/ali/Projects/CleanCoal/Runs/Steady-Laminar-2Way-Gravity/libudf/lnamd64/2ddp'
# Generating udf_names.c because of makefile udf.c
make[2]: Entering directory `/home/ali/Projects/CleanCoal/Runs/Steady-Laminar-2Way-Gravity/libudf/lnamd64/2ddp'
make libudf.so "CFLAGS=-D_lnamd64 -D_GNU_SOURCE -fpic -shared -ansi -Wall -O -DPTR_RESTRICT= " "LDFLAGS=-shared -lm"
make[3]: Entering directory `/home/ali/Projects/CleanCoal/Runs/Steady-Laminar-2Way-Gravity/libudf/lnamd64/2ddp'
# Compiling udf_names.o because of udf_names.c
cc -D_lnamd64 -D_GNU_SOURCE -fpic -shared -ansi -Wall -O -DPTR_RESTRICT= -I/home/ali/Programs/ansys_inc/v130/fluent/fluent13.0.0/`expr "\`pwd\`" : '.*/\(.*\)/[23].*'`/`basename "\`pwd\`"` -I/home/ali/Programs/ansys_inc/v130/fluent/fluent13.0.0/src -I/home/ali/Programs/ansys_inc/v130/fluent/fluent13.0.0/cortex/src -I/home/ali/Programs/ansys_inc/v130/fluent/fluent13.0.0/client/src -I/home/ali/Programs/ansys_inc/v130/fluent/fluent13.0.0/tgrid/src -I/home/ali/Programs/ansys_inc/v130/fluent/fluent13.0.0/multiport/src -I/home/ali/Programs/ansys_inc/v130/fluent/fluent13.0.0/multiport/mpi_wrapper/include -I/home/ali/Programs/ansys_inc/v130/fluent/fluent13.0.0/multiport/mpi_wrapper/src -I. -c udf_names.c
cc: Warning: Option -nsi passed to ld, if ld is invoked, ignored otherwise
cc: -W option with unknown program all
make[3]: *** [udf_names.o] Error 1
# Compiling udf.o because of udf.c
cc -D_lnamd64 -D_GNU_SOURCE -fpic -shared -ansi -Wall -O -DPTR_RESTRICT= -I/home/ali/Programs/ansys_inc/v130/fluent/fluent13.0.0/`expr "\`pwd\`" : '.*/\(.*\)/[23].*'`/`basename "\`pwd\`"` -I/home/ali/Programs/ansys_inc/v130/fluent/fluent13.0.0/src -I/home/ali/Programs/ansys_inc/v130/fluent/fluent13.0.0/cortex/src -I/home/ali/Programs/ansys_inc/v130/fluent/fluent13.0.0/client/src -I/home/ali/Programs/ansys_inc/v130/fluent/fluent13.0.0/tgrid/src -I/home/ali/Programs/ansys_inc/v130/fluent/fluent13.0.0/multiport/src -I/home/ali/Programs/ansys_inc/v130/fluent/fluent13.0.0/multiport/mpi_wrapper/include -I/home/ali/Programs/ansys_inc/v130/fluent/fluent13.0.0/multiport/mpi_wrapper/src -I. -c udf.c
cc: Warning: Option -nsi passed to ld, if ld is invoked, ignored otherwise
cc: -W option with unknown program all
make[3]: *** [udf.o] Error 1
make[3]: Target `libudf.so' not remade because of errors.
make[3]: Leaving directory `/home/ali/Projects/CleanCoal/Runs/Steady-Laminar-2Way-Gravity/libudf/lnamd64/2ddp'
make[2]: *** [lnamd64] Error 2
make[2]: Leaving directory `/home/ali/Projects/CleanCoal/Runs/Steady-Laminar-2Way-Gravity/libudf/lnamd64/2ddp'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/home/ali/Projects/CleanCoal/Runs/Steady-Laminar-2Way-Gravity/libudf/lnamd64/2ddp'

================================================== ======
I could compile UDFs long before but after getting some updates from Opensuse repositories it seems GCC does not function well. I will be grateful if someone helps me to solve this problem.

Thanks in Advance
Ali

Ali.beh September 14, 2011 15:23

Hi

I solved the problem by modifying "makefile.udf" located in
<FLUENT PATH>/fluent13.0.0/src. I changed "CC= cc" to "CC= gcc" and now I can compile UDFs!! :)

omid8 April 8, 2013 18:12

Quote:

Originally Posted by Ali.beh (Post 324143)
Hi

I solved the problem by modifying "makefile.udf" located in
<FLUENT PATH>/fluent13.0.0/src. I changed "CC= cc" to "CC= gcc" and now I can compile UDFs!! :)

hi, i have same problem in win 7/ 64 bit.
Could you explain solution more.
thanks


All times are GMT -4. The time now is 08:53.