CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > SU2 > SU2 Installation

OSError: fcntl.flock Function not implemented

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By mag10100

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 22, 2025, 10:55
Default OSError: fcntl.flock Function not implemented
  #1
New Member
 
Mag
Join Date: Oct 2021
Location: Bangalore, India
Posts: 10
Rep Power: 6
mag10100 is on a distinguished road
I am installing SU2-8.2.0 on our HPC server. I am using the following command for configuring on the server.

./meson.py build --prefix=/home/magans/SU2-8.2.0 -Dcustom-mpi=true

I am getting the following error.

File "/home/magans/SU2-8.2.0/externals/meson/mesonbuild/mesonlib/posix.py", line 32, in __enter__fcntl.flock(self.lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB)
OSError: [Errno 38] Function not implemented

Searching for this error shows that the server file system does not support the file locking function "fcntl.flock."

Your small help can make a big difference for me.

Thank you in advance.
mag10100 is offline   Reply With Quote

Old   July 23, 2025, 04:02
Default
  #2
Senior Member
 
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 833
Rep Power: 23
bigfootedrockmidget is on a distinguished road
Looks like the hpc indeed does not have lock support.
Do you need to load modules on the hpc? Maybe load some python libraries? If your hpc supports conda environments, you can try creating a conda environment with a recent python version and try compiling from there. I think posix.py is in the package os-sys.
bigfootedrockmidget is offline   Reply With Quote

Old   July 29, 2025, 09:39
Default
  #3
New Member
 
Mag
Join Date: Oct 2021
Location: Bangalore, India
Posts: 10
Rep Power: 6
mag10100 is on a distinguished road
I tried this installation after creating the conda environment.

What i think, error can be resolved by using some other function in posix.py that is compatible with the hpc file system. I'm still on this. Let's see.
mag10100 is offline   Reply With Quote

Old   August 10, 2025, 05:52
Default
  #4
New Member
 
Mag
Join Date: Oct 2021
Location: Bangalore, India
Posts: 10
Rep Power: 6
mag10100 is on a distinguished road
I solved this error by bypassing fcntl.flock function as our system's file system does not support this function. We changed SU2-8.2.0/externals/meson/mesonbuild/mesonlib/posix.py script to the following. You can do so if you are using meson in a container or an isolated environment where no concurrency is possible.

--------------------------------------------------
import fcntl
import typing as T

from .universal import MesonException
from .platform import BuildDirLock as BuildDirLockBase

__all__ = ['BuildDirLock']

class BuildDirLock(BuildDirLockBase):

def __enter__(self) -> None:
self.lockfile = open(self.lockfilename, 'w', encoding='utf-8')
try:
fcntl.flock(self.lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB)
except (BlockingIOError, PermissionError):
self.lockfile.close()
raise MesonException('Some other Meson process is already using this build directory. Exiting.')
except OSError as e:
if e.errno == 38: # Function not implemented
print('Warning: File locking is not supported on this filesystem. Continuing without lock.')
else:
self.lockfile.close()
raise

def __exit__(self, *args: T.Any) -> None:
try:
fcntl.flock(self.lockfile, fcntl.LOCK_UN)
except OSError:
pass # Ignore unlock errors if lock was never acquired
self.lockfile.close()

--------------------------------------------
mag10100 is offline   Reply With Quote

Reply

Tags
fcntl.flock function, file system

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] How to define to right point for locationInMesh Mirage12 OpenFOAM Meshing & Mesh Conversion 7 March 13, 2016 15:07
[swak4Foam] installation problem with version 0.2.3 Claudio87 OpenFOAM Community Contributions 9 May 8, 2013 11:20
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 06:42
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 13:21
Droplet Evaporation Christian Main CFD Forum 2 February 27, 2007 07:27


All times are GMT -4. The time now is 15:23.