Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation Problem #162

Closed
hakan-demirli opened this issue Nov 3, 2022 · 2 comments
Closed

Installation Problem #162

hakan-demirli opened this issue Nov 3, 2022 · 2 comments

Comments

@hakan-demirli
Copy link

OS: Ubuntu 20.04.03
Docker version 20.10.21, build baeda1f
Steps Followed:

git clone https://github.com/VLSIDA/OpenRAM
cd OpenRAM/docker
make build

The error:

Removing intermediate container e34bca9e422a
 ---> 8c0cd8bb8731
Step 61/74 : COPY mrg.patch /root/magic
 ---> 9f7403a19450
Step 62/74 : RUN git apply mrg.patch
 ---> Running in 26066a2ba0f1
mrg.patch:10: space before tab in indent.
		    	if (idx < i || i == -1) i = idx;
error: patch failed: commands/CmdLQ.c:1745
error: commands/CmdLQ.c: patch does not apply
The command '/bin/sh -c git apply mrg.patch' returned a non-zero code: 1
docker tag  vlsida/openram-ubuntu:2022-11-03 vlsida/openram-ubuntu:latest
Error response from daemon: No such image: vlsida/openram-ubuntu:2022-11-03
make: *** [Makefile:11: build] Error 1

If I edit the docker file and add --reject --whitespace=fix to the git command. The error evolves into this:

Step 62/74 : RUN git apply --reject --whitespace=fix mrg.patch
 ---> Running in 5646a674572b
Checking patch commands/CmdLQ.c...
error: while searching for:
			if (sl->lab_flags & PORT_DIR_MASK)?
			{?
				idx = (int)sl->lab_port;?
				if (idx < i) i = idx;?
			}?
		}?
#ifdef MAGIC_WRAPPER?

error: patch failed: commands/CmdLQ.c:1745
error: while searching for:
			{?
				idx = (int)sl->lab_port;?
				if (idx > refidx)?
					if (idx < i) i = idx;?
			}?
		}?
#ifdef MAGIC_WRAPPER?

error: patch failed: commands/CmdLQ.c:1764
Applying patch commands/CmdLQ.c with 2 rejects...
Rejected hunk #1.
Rejected hunk #2.
The command '/bin/sh -c git apply --reject --whitespace=fix mrg.patch' returned a non-zero code: 1
@hakan-demirli
Copy link
Author

The solution is to apply dos2unix to all files before compiling.

find /path -type f -print0 | xargs -0 dos2unix --

@hakan-demirli
Copy link
Author

hakan-demirli commented Jan 6, 2023

Nope. The line endings were correct in the repo. My git preferences were wonky. Git automatically converts line endings if autocrlf = true is set in preferences. That was the case for me.
Changing my gitpereferences fixed it.

[core]
	autocrlf = false
	eol = lf

Related: RTimothyEdwards/open_pdks#334

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant