Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Complied UDF in linux and windows

    • 315914335
      Subscriber

      I have a udf that has compiled successfully under windows, but the same c file fails to compile under linux. Please tell me how to solve this problem. My windows version is 2022r1 and 2020r2, and the linux version is 2020r2. Please tell me how to successfully compile this file under linux. Or is it feasible to import the same Windows compiled file into Linux?

    • Rob
      Forum Moderator

      What error are you getting? Did you check for whitespace characters? 

      You can't use the Win10 libudf on Linux. 

    • 315914335
      Subscriber
      Working...
      for d in lnamd64/[23]*; do \
        ( \
          cd $d; \
      if [ -f udf_names.c ]; then \
                        mv -f udf_names.c udf_names.cRenamed; \
                      fi; \
      rm -rf *.{c,h,cpp,hpp}; \
      if [ -f udf_names.cRenamed ]; then \
                        mv -f udf_names.cRenamed udf_names.c; \
                      fi; \
          for f in ../../src/*.{c,h,cpp,hpp} ../../src/makefile ../../src/user.udf; do \
            if [ -f $f -a ! -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
      # linking to ../../src/rate_bfer.c in lnamd64/3ddp_host
      # linking to ../../src/makefile in lnamd64/3ddp_host
       
      # building library in lnamd64/3ddp_host
      make[1]: Entering directory `/home/data/lv/test/density-based/rate1/lnamd64/3ddp_host'
    • Rob
      Forum Moderator

      Nothing diagnostic there, if the code has a problem I'd expect some errors. 

Viewing 3 reply threads
  • The topic ‘Complied UDF in linux and windows’ is closed to new replies.